diff --git a/src/components/Me.tsx b/src/components/Me.tsx index 9b992ed4..4edbae51 100644 --- a/src/components/Me.tsx +++ b/src/components/Me.tsx @@ -394,9 +394,22 @@ const Me: React.FC = ({ } const getReadItemUrl = (item: ReadItem) => { + // Handle nostr-event: URLs specially - route to /e/ path + const urlToCheck = item.url || item.id + if (urlToCheck?.startsWith('nostr-event:')) { + const eventId = urlToCheck.replace('nostr-event:', '') + return `/e/${eventId}` + } + if (item.type === 'article') { - // ID is already in naddr format - return `/a/${item.id}` + // Check if ID is actually an naddr + if (item.id.startsWith('naddr1')) { + return `/a/${item.id}` + } + // Fallback: if it has a URL, use /r/ path + if (item.url) { + return `/r/${encodeURIComponent(item.url)}` + } } else if (item.url) { return `/r/${encodeURIComponent(item.url)}` } @@ -437,6 +450,13 @@ const Me: React.FC = ({ } const handleSelectUrl = (url: string, bookmark?: { id: string; kind: number; tags: string[][]; pubkey: string }) => { + // Handle nostr-event: URLs specially - route to /e/ path + if (url?.startsWith('nostr-event:')) { + const eventId = url.replace('nostr-event:', '') + navigate(`/e/${eventId}`) + return + } + if (bookmark && bookmark.kind === 30023) { // For kind:30023 articles, navigate to the article route const dTag = bookmark.tags.find(t => t[0] === 'd')?.[1] || ''