Deactivate IndexedDB temporarily

This commit is contained in:
Sosthene 2024-10-12 11:34:37 +02:00
parent fe672fce1d
commit 9297efa200

View File

@ -5,7 +5,7 @@ import homeScript from '../html/home.js?raw';
import processPage from '../html/process.html?raw';
import processScript from '../html/process.js?raw';
import { IProcess } from '~/models/process.model';
import Database from './database';
// import Database from './database';
import { WebSocketClient } from '../websockets';
import QRCode from 'qrcode'
import { servicesVersion } from 'typescript';
@ -37,7 +37,7 @@ export default class Services {
public async init(): Promise<void> {
this.notifications = this.getNotifications();
this.sdkClient = await import("../../dist/pkg/sdk_client");
this.database = Database.getInstance()
// this.database = Database.getInstance()
}
@ -240,9 +240,9 @@ export default class Services {
}
}
if(tx.updated_cached_msg && tx.updated_cached_msg.length) {
tx.updated_cached_msg.forEach(message => this.saveTxToDb(message))
}
// if(tx.updated_cached_msg && tx.updated_cached_msg.length) {
// tx.updated_cached_msg.forEach(message => this.saveTxToDb(message))
// }
// if(tx.prd) {
// const parsedPrd = JSON.parse(tx.prd)
@ -308,20 +308,20 @@ export default class Services {
}
}
async saveTxToDb(tx: CachedMessage) {
const database = await Database.getInstance();
const indexedDb = await database.getDb();
await database.writeObject(indexedDb, 'messages', tx, null);
}
// async saveTxToDb(tx: CachedMessage) {
// const database = await Database.getInstance();
// const indexedDb = await database.getDb();
// await database.writeObject(indexedDb, 'messages', tx, null);
// }
async saveCipherTxToDb(tx: string) {
const database = await Database.getInstance();
const indexedDb = await database.getDb();
// async saveCipherTxToDb(tx: string) {
// const database = await Database.getInstance();
// const indexedDb = await database.getDb();
if(tx) {
await database.writeObject(indexedDb, database.getStoreList().AnkCipherMessages, tx, null);
}
}
// if(tx) {
// await database.writeObject(indexedDb, database.getStoreList().AnkCipherMessages, tx, null);
// }
// }
async getAmount() {
const services = await Services.getInstance();