From be33581642182b36c18edc02c58a99b0e8786199 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 29 Aug 2019 05:11:26 +0900 Subject: [PATCH] Fix animation not being performed on new reaction (#5345) * Fix animation not being performed on new reaction * Clean up --- .../common/views/components/reactions-viewer.reaction.vue | 7 +++++++ .../app/common/views/components/reactions-viewer.vue | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/components/reactions-viewer.reaction.vue b/src/client/app/common/views/components/reactions-viewer.reaction.vue index ecd22d3f5..0676c44c7 100644 --- a/src/client/app/common/views/components/reactions-viewer.reaction.vue +++ b/src/client/app/common/views/components/reactions-viewer.reaction.vue @@ -26,6 +26,10 @@ export default Vue.extend({ type: Number, required: true, }, + isInitial: { + type: Boolean, + required: true, + }, note: { type: Object, required: true, @@ -41,6 +45,9 @@ export default Vue.extend({ return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId; }, }, + mounted() { + if (!this.isInitial) this.anime(); + }, watch: { count() { this.anime(); diff --git a/src/client/app/common/views/components/reactions-viewer.vue b/src/client/app/common/views/components/reactions-viewer.vue index 46668054b..8487b68c8 100644 --- a/src/client/app/common/views/components/reactions-viewer.vue +++ b/src/client/app/common/views/components/reactions-viewer.vue @@ -1,6 +1,6 @@ @@ -12,6 +12,11 @@ export default Vue.extend({ components: { XReaction }, + data() { + return { + initialReactions: new Set(Object.keys(this.note.reactions)) + }; + }, props: { note: { type: Object,