From 30343254bd790488dd23bc8d174c0baed799346f Mon Sep 17 00:00:00 2001 From: codytseng Date: Wed, 25 Jun 2025 11:22:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ReplyNoteList/index.tsx | 17 ++++++++++++----- src/lib/event.ts | 12 ++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/components/ReplyNoteList/index.tsx b/src/components/ReplyNoteList/index.tsx index 88ebd5e1..bb677a59 100644 --- a/src/components/ReplyNoteList/index.tsx +++ b/src/components/ReplyNoteList/index.tsx @@ -156,11 +156,18 @@ export default function ReplyNoteList({ index, event }: { index?: number; event: }) } } else if (rootInfo.type === 'A') { - filters.push({ - '#A': [rootInfo.id], - kinds: [ExtendedKind.COMMENT], - limit: LIMIT - }) + filters.push( + { + '#a': [rootInfo.id], + kinds: [kinds.ShortTextNote], + limit: LIMIT + }, + { + '#A': [rootInfo.id], + kinds: [ExtendedKind.COMMENT], + limit: LIMIT + } + ) if (rootInfo.relay) { relayUrls.push(rootInfo.relay) } diff --git a/src/lib/event.ts b/src/lib/event.ts index cc67c188..9720d0c6 100644 --- a/src/lib/event.ts +++ b/src/lib/event.ts @@ -36,10 +36,14 @@ export function isReplyNoteEvent(event: Event) { if (cache !== undefined) return cache const mentionsEventIds: string[] = [] - for (const [tagName, eventId, , marker] of event.tags) { - if (tagName !== 'e' || !eventId) continue + for (const [tagName, id, , marker] of event.tags) { + if (tagName === 'a' && id) { + EVENT_IS_REPLY_NOTE_CACHE.set(event.id, true) + return true + } + if (tagName !== 'e' || !id) continue - mentionsEventIds.push(eventId) + mentionsEventIds.push(id) if (['root', 'reply'].includes(marker)) { EVENT_IS_REPLY_NOTE_CACHE.set(event.id, true) return true @@ -90,7 +94,7 @@ export function getParentEventTag(event?: Event) { } export function getParentAddressableEventTag(event?: Event) { - if (!event || event.kind !== ExtendedKind.COMMENT) return undefined + if (!event || ![kinds.ShortTextNote, ExtendedKind.COMMENT].includes(event.kind)) return undefined return event.tags.find(tagNameEquals('a')) ?? event.tags.find(tagNameEquals('A')) }