fix: Replying to a post sometimes doesn't increase post's reply count

Co-authored-by: Lhcfl <Lhcfl@outlook.com>
This commit is contained in:
Linca 2024-04-24 06:02:37 +00:00 committed by naskya
parent cc37177bb5
commit 71e4621e26
2 changed files with 1 additions and 1 deletions

View file

@ -278,7 +278,6 @@ useNoteCapture({
note, note,
isDeletedRef: isDeleted, isDeletedRef: isDeleted,
onReplied: (replyNote) => { onReplied: (replyNote) => {
note.value.repliesCount += 1;
repliesPagingComponent.value?.append(replyNote); repliesPagingComponent.value?.append(replyNote);
}, },
}); });

View file

@ -21,6 +21,7 @@ export function useNoteCapture(props: {
switch (type) { switch (type) {
case "replied": { case "replied": {
note.value.repliesCount += 1;
if (props.onReplied) { if (props.onReplied) {
const { id: createdId } = body; const { id: createdId } = body;
const replyNote = await os.api("notes/show", { const replyNote = await os.api("notes/show", {