aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src')
-rw-r--r--packages/taler-wallet-webextension/src/browserWorkerEntry.ts6
-rw-r--r--packages/taler-wallet-webextension/src/wxApi.ts11
2 files changed, 10 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/browserWorkerEntry.ts b/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
index 7829e6d65..4494b9af8 100644
--- a/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
+++ b/packages/taler-wallet-webextension/src/browserWorkerEntry.ts
@@ -23,18 +23,18 @@
*/
import { Logger } from "@gnu-taler/taler-util";
-import { CryptoImplementation } from "@gnu-taler/taler-wallet-core";
+import { nativeCrypto } from "@gnu-taler/taler-wallet-core";
const logger = new Logger("browserWorkerEntry.ts");
-const worker: Worker = (self as any) as Worker;
+const worker: Worker = self as any as Worker;
async function handleRequest(
operation: string,
id: number,
args: string[],
): Promise<void> {
- const impl = new CryptoImplementation();
+ const impl = nativeCrypto;
if (!(operation in impl)) {
console.error(`crypto operation '${operation}' not found`);
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);
}