From 2d89741afb0a4d4ebaf2bfeb597e6299998bd0a0 Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Fri, 30 Dec 2022 19:01:01 +0900 Subject: [PATCH] =?UTF-8?q?ReactionsViewer=E3=81=8C=E6=B6=88=E3=81=88?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/MkReactionsViewer.reaction.vue | 1 - packages/frontend/src/components/MkReactionsViewer.vue | 4 +--- packages/frontend/src/scripts/use-note-capture.ts | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkReactionsViewer.reaction.vue b/packages/frontend/src/components/MkReactionsViewer.reaction.vue index 5387f490a1..8f2f48dcd7 100644 --- a/packages/frontend/src/components/MkReactionsViewer.reaction.vue +++ b/packages/frontend/src/components/MkReactionsViewer.reaction.vue @@ -1,6 +1,5 @@ <template> <button - v-if="count > 0" ref="buttonRef" v-ripple="canToggle" class="hkzvhatu _button" diff --git a/packages/frontend/src/components/MkReactionsViewer.vue b/packages/frontend/src/components/MkReactionsViewer.vue index a22f7b6e74..aa4608f849 100644 --- a/packages/frontend/src/components/MkReactionsViewer.vue +++ b/packages/frontend/src/components/MkReactionsViewer.vue @@ -1,10 +1,8 @@ <template> <Transition :name="$store.state.animation ? 'y' : ''"> -<div v-if="Object.keys(note.reactions).length > 0" class="tdflqwzn" :class="{ isMe }"> - <TransitionGroup :name="$store.state.animation ? 'x' : ''"> + <TransitionGroup v-if="Object.keys(note.reactions).length > 0" :name="$store.state.animation ? 'x' : ''" tag="div" class="tdflqwzn" :class="{ isMe }"> <XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/> </TransitionGroup> -</div> </Transition> </template> diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts index e6bdb345c4..389ee12561 100644 --- a/packages/frontend/src/scripts/use-note-capture.ts +++ b/packages/frontend/src/scripts/use-note-capture.ts @@ -45,6 +45,7 @@ export function useNoteCapture(props: { const currentCount = (note.value.reactions || {})[reaction] || 0; note.value.reactions[reaction] = Math.max(0, currentCount - 1); + if (note.value.reactions[reaction] === 0) delete note.value.reactions[reaction]; if ($i && (body.userId === $i.id)) { note.value.myReaction = null; -- GitLab