diff --git a/src/components/NoteContent.test.tsx b/src/components/NoteContent.test.tsx index a3244d1..b4336a9 100644 --- a/src/components/NoteContent.test.tsx +++ b/src/components/NoteContent.test.tsx @@ -98,8 +98,8 @@ describe('NoteContent', () => { expect(nostrHashtag).toBeInTheDocument(); expect(bitcoinHashtag).toBeInTheDocument(); - expect(nostrHashtag).toHaveAttribute('href', '/t/nostr'); - expect(bitcoinHashtag).toHaveAttribute('href', '/t/bitcoin'); + expect(nostrHashtag).toHaveAttribute('href', '/tag/nostr'); + expect(bitcoinHashtag).toHaveAttribute('href', '/tag/bitcoin'); }); it('generates deterministic names for users without metadata and styles them differently', () => { diff --git a/src/components/NoteContent.tsx b/src/components/NoteContent.tsx index a7a7c30..9327ce9 100644 --- a/src/components/NoteContent.tsx +++ b/src/components/NoteContent.tsx @@ -83,7 +83,7 @@ export function NoteContent({ parts.push( {hashtag} diff --git a/src/hooks/useHashtagFeed.ts b/src/hooks/useHashtagFeed.ts index 6c0be5f..13e8c8e 100644 --- a/src/hooks/useHashtagFeed.ts +++ b/src/hooks/useHashtagFeed.ts @@ -8,13 +8,18 @@ import type { NostrEvent } from '@nostrify/nostrify'; export function useHashtagFeed(hashtag: string) { const { nostr } = useNostr(); const normalizedTag = hashtag.toLowerCase(); + + // Search for both normalized and original tag if they differ + const tagsToSearch = normalizedTag === hashtag + ? [normalizedTag] + : [normalizedTag, hashtag]; return useInfiniteQuery({ queryKey: ['hashtag-feed', normalizedTag], queryFn: async ({ pageParam, signal }) => { const filter = pageParam - ? { kinds: [20], '#t': [normalizedTag], limit: 20, until: pageParam as number } - : { kinds: [20], '#t': [normalizedTag], limit: 20 }; + ? { kinds: [20], '#t': tagsToSearch, limit: 20, until: pageParam as number } + : { kinds: [20], '#t': tagsToSearch, limit: 20 }; const events = await nostr.query([filter], { signal: AbortSignal.any([signal, AbortSignal.timeout(1500)])