From 411765fb53a7374472a1ae94c387f34663c3d19e Mon Sep 17 00:00:00 2001 From: escapedcat Date: Fri, 25 Nov 2022 18:27:55 +0100 Subject: [PATCH] refactor(nostr): use diexie api to get boolean #1727 --- src/app/screens/Nostr/ConfirmSignMessage.tsx | 1 - .../background-script/actions/nostr/signEventOrPrompt.ts | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/screens/Nostr/ConfirmSignMessage.tsx b/src/app/screens/Nostr/ConfirmSignMessage.tsx index 1f0fd2016b..ea0d5dffb1 100644 --- a/src/app/screens/Nostr/ConfirmSignMessage.tsx +++ b/src/app/screens/Nostr/ConfirmSignMessage.tsx @@ -46,7 +46,6 @@ function ConfirmSignMessage() { msg.reply({ confirm: true, - rememberPermission, }); setSuccessMessage(tCommon("success")); } catch (e) { diff --git a/src/extension/background-script/actions/nostr/signEventOrPrompt.ts b/src/extension/background-script/actions/nostr/signEventOrPrompt.ts index 54f55ccbb9..9c60eea4e1 100644 --- a/src/extension/background-script/actions/nostr/signEventOrPrompt.ts +++ b/src/extension/background-script/actions/nostr/signEventOrPrompt.ts @@ -18,21 +18,18 @@ const signEventOrPrompt = async (message: MessageSignEvent) => { }; } - const findPermission = await db.permissions + const hasPermission = await db.permissions .where("host") .equalsIgnoreCase(message.origin.host) .and( (permission) => permission.enabled && permission.method === "signMessage" ) - .toArray(); - - const hasPermission = findPermission.length > 0; + .first(); try { if (!hasPermission) { const response = await utils.openPrompt<{ confirm: boolean; - rememberPermission: boolean; }>({ ...message, action: "public/nostr/confirmSignMessage",