diff options
author | Florian Dold <florian@dold.me> | 2022-03-23 21:24:23 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-23 21:24:36 +0100 |
commit | d881f4fd258a27cc765a25c24e5fef9f86b6226f (patch) | |
tree | 3254444f93ef552f4ac65f14e581ed761b9df79e /packages/taler-wallet-webextension/src/wxApi.ts | |
parent | e21c1b31928cd6bfe90150ea2de19799b6359c40 (diff) | |
download | wallet-core-d881f4fd258a27cc765a25c24e5fef9f86b6226f.tar.xz |
wallet: simplify crypto workers
Diffstat (limited to 'packages/taler-wallet-webextension/src/wxApi.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wxApi.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/wxApi.ts b/packages/taler-wallet-webextension/src/wxApi.ts index 4b0383f88..dd53a4feb 100644 --- a/packages/taler-wallet-webextension/src/wxApi.ts +++ b/packages/taler-wallet-webextension/src/wxApi.ts @@ -97,10 +97,10 @@ export interface UpgradeResponse { async function callBackend(operation: string, payload: any): Promise<any> { let response: CoreApiResponse; try { - response = await platform.setMessageToWalletBackground(operation, payload) + response = await platform.setMessageToWalletBackground(operation, payload); } catch (e) { console.log("Error calling backend"); - throw new Error(`Error contacting backend: ${e}`) + throw new Error(`Error contacting backend: ${e}`); } console.log("got response", response); if (response.type === "error") { @@ -413,12 +413,15 @@ export function importDB(dump: any): Promise<void> { return callBackend("importDb", { dump }); } -export function onUpdateNotification(messageTypes: Array<NotificationType>, doCallback: () => void): () => void { +export function onUpdateNotification( + messageTypes: Array<NotificationType>, + doCallback: () => void, +): () => void { const listener = (message: MessageFromBackend): void => { const shouldNotify = messageTypes.includes(message.type); if (shouldNotify) { doCallback(); } }; - return platform.listenToWalletNotifications(listener) + return platform.listenToWalletNotifications(listener); } |