commit 29674bcc13029b45e1f829174d26dc16ecbc9e06 parent d1cfae937cb3eb7ce653712477ff11490a040ede Author: triesap <137732411+triesap@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:10:08 +0000 client: edit iclientnostrlib Diffstat:
| M | client/src/nostr/lib.ts | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/client/src/nostr/lib.ts b/client/src/nostr/lib.ts @@ -55,10 +55,10 @@ export class ClientNostrLib implements IClientNostrLib { * * @returns nostr public key npub */ - public npub(public_key_hex: string | undefined): string { - if (!public_key_hex) return ``; - const npub = nip19.npubEncode(public_key_hex) - return npub; + public npub(public_key_hex: string | undefined, fallback_to_hex?: boolean): string { + if (!public_key_hex) return fallback_to_hex ? public_key_hex : ``; + const npub = nip19.npubEncode(public_key_hex); + return npub ? npub : fallback_to_hex ? public_key_hex : ``; } /**