taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit eff953b8686b2236a60b3fb947f7b01846beb4d5
parent 87f78f03f3cebc4223c074e2d410df4b4050647e
Author: Florian Dold <florian@dold.me>
Date:   Wed, 13 Nov 2024 14:07:13 +0100

webext: fix DB instantiation

Diffstat:
Mpackages/taler-wallet-webextension/src/wxBackend.ts | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -44,6 +44,7 @@ import { import { HttpRequestLibrary } from "@gnu-taler/taler-util/http"; import { DbAccess, + HttpFactory, SynchronousCryptoWorkerFactoryPlain, Wallet, WalletApiOperation, @@ -54,6 +55,7 @@ import { importDb, } from "@gnu-taler/taler-wallet-core"; import { BrowserFetchHttpLib } from "@gnu-taler/web-util/browser"; +import { BridgeIDBFactory } from "../../idb-bridge/src/bridge-idb.js"; import { MessageFromFrontend, MessageResponse } from "./platform/api.js"; import { platform } from "./platform/background.js"; import { ExtensionOperations } from "./taler-wallet-interaction-loader.js"; @@ -460,8 +462,16 @@ async function reinitWallet(): Promise<void> { const settings = await platform.getSettingsFromStorage(); logger.info("Setting up wallet"); const wallet = await Wallet.create( - indexedDB as any, - httpFactory as any, + { + idbFactory: indexedDB as any as BridgeIDBFactory, + exportToFile() { + throw Error("DB file export not supported for platform webext"); + }, + getStats() { + throw Error("DB statistics not supported for platform webext"); + }, + }, + httpFactory as any as HttpFactory, timer, cryptoWorker, );