From 6670c72f8bfd9cd1c076fe85acdf126fb132d026 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 26 Jan 2023 08:46:21 +0000 Subject: [PATCH] fix(client): note reacted reflection failed Fix #9730 --- packages/frontend/src/scripts/use-note-capture.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts index 389ee12561..ffe33cccc0 100644 --- a/packages/frontend/src/scripts/use-note-capture.ts +++ b/packages/frontend/src/scripts/use-note-capture.ts @@ -20,11 +20,8 @@ export function useNoteCapture(props: { case 'reacted': { const reaction = body.reaction; - if (body.emoji) { - const emojis = note.value.emojis || []; - if (!emojis.includes(body.emoji)) { - note.value.emojis = [...emojis, body.emoji]; - } + if (body.emoji && !(body.emoji.name in note.value.reactionEmojis)) { + note.value.reactionEmojis[body.emoji.name] = body.emoji.url; } // TODO: reactionsプロパティがない場合ってあったっけ? なければ || {} は消せる