mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-11 13:20:37 +02:00
Fix amber signer missing pubkey
This commit is contained in:
parent
77c0f0fbbf
commit
1353ccdfd9
5
.changeset/blue-schools-tap.md
Normal file
5
.changeset/blue-schools-tap.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": patch
|
||||
---
|
||||
|
||||
Fix amber signer missing pubkey
|
@ -84,8 +84,10 @@ export default class AmberSigner implements Nip07Signer {
|
||||
if (this.pubkey) return this.pubkey;
|
||||
|
||||
const result = await this.intentRequest(AmberSigner.createGetPublicKeyIntent());
|
||||
if (isHexKey(result)) return result;
|
||||
else if (result.startsWith("npub") || result.startsWith("nprofile")) {
|
||||
if (isHexKey(result)) {
|
||||
this.pubkey = result;
|
||||
return result;
|
||||
} else if (result.startsWith("npub") || result.startsWith("nprofile")) {
|
||||
const decode = nip19.decode(result);
|
||||
const pubkey = getPubkeyFromDecodeResult(decode);
|
||||
if (!pubkey) throw new Error("Expected npub from clipboard");
|
||||
|
Loading…
x
Reference in New Issue
Block a user