ReactionsViewerが消えることがある問題を修正
This commit is contained in:
parent
c631e14e53
commit
2d89741afb
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
v-if="count > 0"
|
|
||||||
ref="buttonRef"
|
ref="buttonRef"
|
||||||
v-ripple="canToggle"
|
v-ripple="canToggle"
|
||||||
class="hkzvhatu _button"
|
class="hkzvhatu _button"
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Transition :name="$store.state.animation ? 'y' : ''">
|
<Transition :name="$store.state.animation ? 'y' : ''">
|
||||||
<div v-if="Object.keys(note.reactions).length > 0" class="tdflqwzn" :class="{ isMe }">
|
<TransitionGroup v-if="Object.keys(note.reactions).length > 0" :name="$store.state.animation ? 'x' : ''" tag="div" class="tdflqwzn" :class="{ isMe }">
|
||||||
<TransitionGroup :name="$store.state.animation ? 'x' : ''">
|
|
||||||
<XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/>
|
<XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/>
|
||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
</div>
|
|
||||||
</Transition>
|
</Transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ export function useNoteCapture(props: {
|
||||||
const currentCount = (note.value.reactions || {})[reaction] || 0;
|
const currentCount = (note.value.reactions || {})[reaction] || 0;
|
||||||
|
|
||||||
note.value.reactions[reaction] = Math.max(0, currentCount - 1);
|
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)) {
|
if ($i && (body.userId === $i.id)) {
|
||||||
note.value.myReaction = null;
|
note.value.myReaction = null;
|
||||||
|
|
Loading…
Reference in a new issue