Skip to content

Commit 729193b

Browse files
committed
reply count fix
1 parent 496e5e0 commit 729193b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/shared/components/event/reactions/FeedItemComment.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {useUserStore} from "@/stores/user"
1010
import Icon from "../../Icons/Icon"
1111

1212
import NoteCreator from "@/shared/components/create/NoteCreator.tsx"
13-
import {getEventReplyingTo} from "@/utils/nostr"
13+
import {getEventReplyingTo, getEventRoot} from "@/utils/nostr"
1414
import {LRUCache} from "typescript-lru-cache"
1515
import {KIND_TEXT_NOTE} from "@/utils/constants"
1616

@@ -56,8 +56,9 @@ function FeedItemComment({event, showReactionCounts = true}: FeedItemCommentProp
5656
const sub = ndk().subscribe(filter)
5757

5858
sub?.on("event", (e: NDKEvent) => {
59-
if (shouldHideAuthor(e.author.pubkey) || getEventReplyingTo(e) !== event.id)
60-
return
59+
if (shouldHideAuthor(e.author.pubkey)) return
60+
// Count if this event is either replying to the current event or has it as root
61+
if (getEventReplyingTo(e) !== event.id && getEventRoot(e) !== event.id) return
6162
replies.add(e.id)
6263
debouncedSetReplyCount(replies.size)
6364
})

0 commit comments

Comments
 (0)