diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index 188f4fa..2a265d7 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -269,6 +269,19 @@ const MessageItem = memo(function MessageItem({ zapRequest?.tags.find((t) => t[0] === "e")?.[1] || undefined; + // Check if the replied-to event exists and is a chat kind + const replyEvent = use$( + () => (zapReplyTo ? eventStore.event(zapReplyTo) : undefined), + [zapReplyTo], + ); + + // Only show reply preview if: + // 1. The event exists in our store + // 2. The event is a chat kind (9, 9321, 1311) + const chatKinds = [9, 9321, 1311]; + const shouldShowReplyPreview = + zapReplyTo && replyEvent && chatKinds.includes(replyEvent.kind); + return (