From aa652aac8a88f6256834db63435a670a2bca797b Mon Sep 17 00:00:00 2001 From: Xeltica <7106976+Xeltica@users.noreply.github.com> Date: Sun, 21 Jun 2020 22:34:28 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=83=E3=83=97=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E3=81=AA=E3=83=AA=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E6=8A=BC=E3=81=97=E3=81=A6=E3=82=82=E3=83=91?= =?UTF-8?q?=E3=83=BC=E3=83=86=E3=82=A3=E3=82=AF=E3=83=AB=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=20(#6472?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * resolve #6453 * リアクションビューワーのトグル可能判定にログインしているかどうかも反映 --- src/client/components/reactions-viewer.reaction.vue | 13 ++++++------- src/client/directives/particle.ts | 2 ++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/client/components/reactions-viewer.reaction.vue b/src/client/components/reactions-viewer.reaction.vue index 6b72f2e10..639a1603c 100644 --- a/src/client/components/reactions-viewer.reaction.vue +++ b/src/client/components/reactions-viewer.reaction.vue @@ -9,9 +9,9 @@ @mouseleave="onMouseleave" @touchend="onMouseleave" ref="reaction" - v-particle + v-particle="canToggle" > - + {{ count }} @@ -55,21 +55,20 @@ export default Vue.extend({ return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId; }, canToggle(): boolean { - return !this.reaction.match(/@\w/); + return !this.reaction.match(/@\w/) && !this.isMe && this.$store.getters.isSignedIn; }, }, - mounted() { - if (!this.isInitial) this.anime(); - }, watch: { count(newCount, oldCount) { if (oldCount < newCount) this.anime(); if (this.details != null) this.openDetails(); }, }, + mounted() { + if (!this.isInitial) this.anime(); + }, methods: { toggleReaction() { - if (this.isMe) return; if (!this.canToggle) return; const oldReaction = this.note.myReaction; diff --git a/src/client/directives/particle.ts b/src/client/directives/particle.ts index 41509b4ed..4fb2a7948 100644 --- a/src/client/directives/particle.ts +++ b/src/client/directives/particle.ts @@ -2,6 +2,8 @@ import Particle from '../components/particle.vue'; export default { bind(el, binding, vn) { + // 明示的に false であればバインドしない + if (binding.value === false) return; el.addEventListener('click', () => { const rect = el.getBoundingClientRect();