Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pubkey prompt triggering even if reasonable permissions set #3240

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: pubkey prompt triggering even if reasonable permissions set
pavanjoshi914 committed Sep 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9edef3b8bbcb7522d414fa127812a5c1fdeb0257
18 changes: 10 additions & 8 deletions src/extension/background-script/actions/nostr/enable.ts
Original file line number Diff line number Diff line change
@@ -130,14 +130,16 @@ const enable = async (message: MessageAllowanceEnable, sender: Sender) => {
EventKind.UploadChunk,
EventKind.RemoteSign,
];

reasonableEventKindIds.forEach(async (kindId) => {
await addPermissionFor(
PermissionMethodNostr.NOSTR_SIGNMESSAGE + "/" + kindId,
host,
false
);
});
// when addding multiple permissions at once, the flow shall wait until all asynchronous addPermissionFor calls are completed.
await Promise.all(
reasonableEventKindIds.map(async (kindId) => {
await addPermissionFor(
PermissionMethodNostr.NOSTR_SIGNMESSAGE + "/" + kindId,
host,
false
);
})
);
} else if (response.data.preset === NostrPermissionPreset.TRUST_FULLY) {
Object.values(PermissionMethodNostr).forEach(async (permission) => {
await addPermissionFor(permission, host, false);