show and copy npub

This commit is contained in:
Jon Staab
2025-07-02 16:48:44 -07:00
parent 4bbc0878f7
commit 9e8aa2ef3a
2 changed files with 4 additions and 6 deletions

View File

@@ -242,9 +242,7 @@ export const checkRelayAccess = async (url: string, claim = "") => {
if (error?.startsWith("mute: ")) return if (error?.startsWith("mute: ")) return
// Ignore rejected empty claims // Ignore rejected empty claims
if (!claim && error?.includes("invite code")) { if (!claim && error?.includes("invite code")) return
return `failed to request access to relay`
}
return message return message
} }

View File

@@ -17,11 +17,11 @@
import {pushModal} from "@app/modal" import {pushModal} from "@app/modal"
import {clip} from "@app/toast" import {clip} from "@app/toast"
const npub = nip19.npubEncode($pubkey!)
const profile = deriveProfile($pubkey!) const profile = deriveProfile($pubkey!)
const pubkeyDisplay = displayPubkey($pubkey!) const pubkeyDisplay = displayPubkey($pubkey!)
const copyNpub = () => clip(nip19.npubEncode($session!.pubkey)) const copyNpub = () => clip(npub)
const copyNsec = () => clip(nip19.nsecEncode(hexToBytes($session!.secret!))) const copyNsec = () => clip(nip19.nsecEncode(hexToBytes($session!.secret!)))
@@ -93,7 +93,7 @@
<label class="input input-bordered flex w-full items-center justify-between gap-2"> <label class="input input-bordered flex w-full items-center justify-between gap-2">
<div class="row-2 flex-grow items-center"> <div class="row-2 flex-grow items-center">
<Icon icon="link-round" /> <Icon icon="link-round" />
<input readonly class="ellipsize flex-grow" value={$session?.pubkey} /> <input readonly class="ellipsize flex-grow" value={npub} />
</div> </div>
<Button class="flex items-center" onclick={copyNpub}> <Button class="flex items-center" onclick={copyNpub}>
<Icon icon="copy" /> <Icon icon="copy" />