From a866040fc1844124a0fd3c1cb78243f979dfffb2 Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 12:13:18 +0200 Subject: [PATCH] feat: support nprofile identifiers on /p/ profile pages - Profile pages now accept both npub and nprofile identifiers (NIP-19) - Extract pubkey from nprofile.data.pubkey when decoding - Maintains backward compatibility with existing npub links - Users can now share profiles with relay metadata included --- src/components/Bookmarks.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 216e957c..e57e60f1 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -58,16 +58,18 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => { // Extract tab from profile routes const profileTab = location.pathname.endsWith('/writings') ? 'writings' : 'highlights' - // Decode npub to pubkey for profile view + // Decode npub or nprofile to pubkey for profile view let profilePubkey: string | undefined if (npub && showProfile) { try { const decoded = nip19.decode(npub) if (decoded.type === 'npub') { profilePubkey = decoded.data + } else if (decoded.type === 'nprofile') { + profilePubkey = decoded.data.pubkey } } catch (err) { - console.error('Failed to decode npub:', err) + console.error('Failed to decode npub/nprofile:', err) } }