diff --git a/src/extension/background-script/actions/nostr/getPublicKeyOrPrompt.ts b/src/extension/background-script/actions/nostr/getPublicKeyOrPrompt.ts index 9abebc5bb7..07dd116e6a 100644 --- a/src/extension/background-script/actions/nostr/getPublicKeyOrPrompt.ts +++ b/src/extension/background-script/actions/nostr/getPublicKeyOrPrompt.ts @@ -18,7 +18,7 @@ const getPublicKeyOrPrompt = async (message: MessagePublicKeyGet) => { ); if (hasPermission) { - const publicKey = state.getState().getNostr().getPublicKey(); + const publicKey = await state.getState().getNostr().getPublicKey(); return { data: publicKey }; } else { const promptResponse = await utils.openPrompt<{ @@ -39,7 +39,7 @@ const getPublicKeyOrPrompt = async (message: MessagePublicKeyGet) => { if (promptResponse.data.confirm) { // Normally `openPrompt` would throw already, but to make sure we got a confirm from the user we check this here - const publicKey = state.getState().getNostr().getPublicKey(); + const publicKey = await state.getState().getNostr().getPublicKey(); return { data: publicKey }; } else { return { error: "User rejected" };