From 05ca35feb105fb9284e400bead3f9fcb45f50cf1 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 8 Feb 2025 09:22:06 +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/NoteCard/RepostNoteCard.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/NoteCard/RepostNoteCard.tsx b/src/components/NoteCard/RepostNoteCard.tsx index 4f44123..aee6fe2 100644 --- a/src/components/NoteCard/RepostNoteCard.tsx +++ b/src/components/NoteCard/RepostNoteCard.tsx @@ -15,8 +15,8 @@ export default function RepostNoteCard({ }) { const { mutePubkeys } = useMuteList() const targetEvent = useMemo(() => { - const targetEvent = event.content ? (JSON.parse(event.content) as Event) : null try { + const targetEvent = event.content ? (JSON.parse(event.content) as Event) : null if (!targetEvent || !verifyEvent(targetEvent) || targetEvent.kind !== kinds.ShortTextNote) { return null } @@ -28,11 +28,10 @@ export default function RepostNoteCard({ client.trackEventSeenOn(targetEvent.id, relay) }) } + return targetEvent } catch { return null } - - return targetEvent }, [event]) if (!targetEvent) return null if (filterMutedNotes && mutePubkeys.includes(targetEvent.pubkey)) {