fix(popup): depth calculation for kind 1

This commit is contained in:
en 2025-02-21 10:51:38 +01:00
parent 6dc1556b4c
commit fbd9b7e527

View File

@ -40,6 +40,7 @@ import {
} from '@nostr-dev-kit/ndk' } from '@nostr-dev-kit/ndk'
import { NoteQuoteRepostPopup } from 'components/Notes/NoteQuoteRepostPopup' import { NoteQuoteRepostPopup } from 'components/Notes/NoteQuoteRepostPopup'
import { NoteRepostPopup } from 'components/Notes/NoteRepostPopup' import { NoteRepostPopup } from 'components/Notes/NoteRepostPopup'
import _ from 'lodash'
interface CommentsPopupProps { interface CommentsPopupProps {
title: string title: string
@ -63,12 +64,14 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {
? `${appRoutes.feed}/` ? `${appRoutes.feed}/`
: undefined : undefined
const { event } = useLoaderData() as CommentsLoaderResult const { event } = useLoaderData() as CommentsLoaderResult
const eTags = event.getMatchingTags('e')
const lastETag = _.last(eTags)
const { const {
size, size,
parent: replyEvent, parent: replyEvent,
isComplete, isComplete,
root: rootEvent root: rootEvent
} = useReplies(event.tagValue('e')) } = useReplies(lastETag?.[1])
const isRoot = event.tagValue('a') === event.tagValue('A') const isRoot = event.tagValue('a') === event.tagValue('A')
const [profile, setProfile] = useState<UserProfile>() const [profile, setProfile] = useState<UserProfile>()
const { commentEvents, setCommentEvents } = useComments( const { commentEvents, setCommentEvents } = useComments(