Skip to content

Commit

Permalink
refactor(nostr): use diexie api to get boolean #1727
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Nov 29, 2022
1 parent 66f7dab commit 411765f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/app/screens/Nostr/ConfirmSignMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function ConfirmSignMessage() {

msg.reply({
confirm: true,
rememberPermission,
});
setSuccessMessage(tCommon("success"));
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 411765f

Please sign in to comment.