From e2cab2aa9b1c8b7b08e2f0cd8bc29be8729948f0 Mon Sep 17 00:00:00 2001 From: Natty Date: Wed, 15 Nov 2023 01:16:34 +0100 Subject: [PATCH] Frontend: Fixed reactions overriding the self reaction flag --- .../frontend/client/src/scripts/use-note-capture.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fe_calckey/frontend/client/src/scripts/use-note-capture.ts b/fe_calckey/frontend/client/src/scripts/use-note-capture.ts index 21865d0..535ff2c 100644 --- a/fe_calckey/frontend/client/src/scripts/use-note-capture.ts +++ b/fe_calckey/frontend/client/src/scripts/use-note-capture.ts @@ -39,10 +39,13 @@ export function useNoteCapture(props: { const selfReact = ($i && body.userId === $i.id) || false; if (foundReaction >= 0) { + const [reaction, cnt, selfReactPrev] = toRaw( + note.value.reactions[foundReaction] + ); note.value.reactions[foundReaction] = [ - toRaw(note.value.reactions[foundReaction][0]), - note.value.reactions[foundReaction][1] + 1, - selfReact, + reaction, + cnt + 1, + selfReactPrev || selfReact, ]; } else { note.value.reactions.push([reactionType, 1, selfReact]);