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(