fix memory. Squashed commit of the following:

commit 1c24e48f2528238aeac417866ccec9ee3deced5f
Author: fyears <1142836+fyears@users.noreply.github.com>
Date:   Fri Mar 25 02:08:05 2022 +0800

    just some trying
This commit is contained in:
fyears
2022-03-26 09:45:48 +08:00
parent a5e415aeaf
commit 6474faad51
4 changed files with 59 additions and 26 deletions
+20
View File
@@ -196,6 +196,26 @@ export const prepareDBs = async (vaultRandomID: string) => {
return db;
};
export const dropDBs = async (db: InternalDBs) => {
const a1 = localforage.dropInstance({
name: DEFAULT_DB_NAME,
storeName: DEFAULT_TBL_VERSION,
});
const a2 = localforage.dropInstance({
name: DEFAULT_DB_NAME,
storeName: DEFAULT_TBL_DELETE_HISTORY,
});
const a3 = localforage.dropInstance({
name: DEFAULT_DB_NAME,
storeName: DEFAULT_TBL_SYNC_MAPPING,
});
const a4 = localforage.dropInstance({
name: DEFAULT_DB_NAME,
storeName: DEFAULT_SYNC_PLANS_HISTORY,
});
await Promise.all([a1, a2, a3, a4]);
};
export const destroyDBs = async () => {
// await localforage.dropInstance({
// name: DEFAULT_DB_NAME,