From fbd9b7e527b2d9692e49fe26427bdcebbe12ec46 Mon Sep 17 00:00:00 2001 From: en Date: Fri, 21 Feb 2025 10:51:38 +0100 Subject: [PATCH] fix(popup): depth calculation for kind 1 --- src/components/comment/CommentsPopup.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/comment/CommentsPopup.tsx b/src/components/comment/CommentsPopup.tsx index 56698f0..b7c4d80 100644 --- a/src/components/comment/CommentsPopup.tsx +++ b/src/components/comment/CommentsPopup.tsx @@ -40,6 +40,7 @@ import { } from '@nostr-dev-kit/ndk' import { NoteQuoteRepostPopup } from 'components/Notes/NoteQuoteRepostPopup' import { NoteRepostPopup } from 'components/Notes/NoteRepostPopup' +import _ from 'lodash' interface CommentsPopupProps { title: string @@ -63,12 +64,14 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => { ? `${appRoutes.feed}/` : undefined const { event } = useLoaderData() as CommentsLoaderResult + const eTags = event.getMatchingTags('e') + const lastETag = _.last(eTags) const { size, parent: replyEvent, isComplete, root: rootEvent - } = useReplies(event.tagValue('e')) + } = useReplies(lastETag?.[1]) const isRoot = event.tagValue('a') === event.tagValue('A') const [profile, setProfile] = useState() const { commentEvents, setCommentEvents } = useComments(