Fix pubkey sign in.
Added try/catch and updated awaits for async methods in regards to sign in attempts. This appears to resolve some race conditions with nos2x extension. More testing to be performed.
This commit is contained in:
parent
51ab5aae2a
commit
7ce72540cf
3 changed files with 21 additions and 12 deletions
|
@ -245,9 +245,13 @@ async function get_pubkey(use_prompt=true) {
|
|||
return pubkey
|
||||
if (window.nostr && window.nostr.getPublicKey) {
|
||||
log_debug("calling window.nostr.getPublicKey()...")
|
||||
const pubkey = await window.nostr.getPublicKey()
|
||||
try {
|
||||
pubkey = await window.nostr.getPublicKey()
|
||||
return await handle_pubkey(pubkey)
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
log_debug("got %s pubkey from nos2x", pubkey)
|
||||
return await handle_pubkey(pubkey)
|
||||
}
|
||||
if (!use_prompt)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue