diff options
author | Florian Dold <florian@dold.me> | 2021-01-13 00:50:56 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-01-13 00:50:56 +0100 |
commit | 050999a910837f8a5353b1584af2b03bd8dad93d (patch) | |
tree | 8b3611476d61be56411be4104194dddda5f6d6c2 /packages/taler-wallet-webextension | |
parent | a5681579fbddb001f5b7118fe705c6643581c722 (diff) |
implement infrastructure for future DB migrations via backup
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r-- | packages/taler-wallet-webextension/src/wxBackend.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index e1dcdde49..95cd5f021 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -24,7 +24,6 @@ * Imports. */ import { isFirefox, getPermissionsApi } from "./compat"; -import MessageSender = chrome.runtime.MessageSender; import { extendedPermissions } from "./permissions"; import { @@ -40,6 +39,7 @@ import { CoreApiResponse, WalletDiagnostics, CoreApiResponseSuccess, + Stores, } from "taler-wallet-core"; import { BrowserHttpLib } from "./browserHttpLib"; import { BrowserCryptoWorkerFactory } from "./browserCryptoWorkerFactory"; @@ -50,7 +50,7 @@ import { BrowserCryptoWorkerFactory } from "./browserCryptoWorkerFactory"; */ let currentWallet: Wallet | undefined; -let currentDatabase: IDBDatabase | undefined; +let currentDatabase: Database<typeof Stores> | undefined; /** * Last version if an outdated DB, if applicable. @@ -135,7 +135,7 @@ async function dispatch( setupHeaderListener(); r = wrapResponse({ newValue: true }); } else { - await new Promise((resolve, reject) => { + await new Promise<void>((resolve, reject) => { getPermissionsApi().remove(extendedPermissions, (rem) => { console.log("permissions removed:", rem); resolve(); @@ -246,7 +246,7 @@ async function reinitWallet(): Promise<void> { const http = new BrowserHttpLib(); console.log("setting wallet"); const wallet = new Wallet( - new Database(currentDatabase), + currentDatabase, http, new BrowserCryptoWorkerFactory(), ); |