show reply count in feed
continuous-integration/drone/push Build is running Details

This commit is contained in:
Martti Malmi 2024-02-04 07:50:45 +02:00
parent d42d26fc20
commit 2099eddebc
3 changed files with 4 additions and 3 deletions

View File

@ -22,7 +22,7 @@ export default function NoteFooter(props: NoteFooterProps) {
const [showReactions, setShowReactions] = useState(false);
const related = useReactions("reactions", ids, undefined, false);
const { reactions, zaps, reposts } = useEventReactions(link, related);
const { replies, reactions, zaps, reposts } = useEventReactions(link, related);
const { positive } = reactions;
const { preferences: prefs, readonly } = useLogin(s => ({
@ -33,7 +33,7 @@ export default function NoteFooter(props: NoteFooterProps) {
return (
<div className="flex flex-row gap-4 overflow-hidden max-w-full h-6 items-center">
<ReplyButton ev={ev} replyCount={props.replyCount} readonly={readonly} />
<ReplyButton ev={ev} replyCount={props.replyCount ?? replies.length} readonly={readonly} />
<RepostButton ev={ev} reposts={reposts} />
{prefs.enableReactions && <LikeButton ev={ev} positiveReactions={positive} />}
{CONFIG.showPowIcon && <PowIcon ev={ev} />}

View File

@ -47,6 +47,7 @@ export function useEventReactions(link: NostrLink, related: ReadonlyArray<Tagged
positive: groupReactions[Reaction.Positive] ?? [],
negative: groupReactions[Reaction.Negative] ?? [],
},
replies: reactionKinds[String(EventKind.TextNote)] ?? [],
reposts,
zaps,
others: Object.fromEntries(

View File

@ -23,7 +23,7 @@ export function useReactions(
);
for (const [, v] of Object.entries(grouped)) {
rb.withFilter().kinds([EventKind.Reaction, EventKind.Repost, EventKind.ZapReceipt]).replyToLink(v);
rb.withFilter().kinds([EventKind.TextNote, EventKind.Reaction, EventKind.Repost, EventKind.ZapReceipt]).replyToLink(v);
}
}
others?.(rb);