From 2522e7388d4d0b92d4517f2c07190e8f88394026 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 31 Jul 2020 19:09:38 +0900 Subject: [PATCH] fix(client): Reactivate poll --- src/client/components/note.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client/components/note.vue b/src/client/components/note.vue index 69ab4ae444..322b634218 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -406,18 +406,18 @@ export default Vue.extend({ ...this.appearNote, }; + const choices = [...this.appearNote.poll.choices]; + choices[choice] = { + ...choices[choice], + votes: choices[choice].votes + 1, + ...(body.userId === this.$store.state.i.id ? { + isVoted: true + } : {}) + }; + n.poll = { ...this.appearNote.poll, - choices: { - ...this.appearNote.poll.choices, - [choice]: { - ...this.appearNote.poll.choices[choice], - votes: this.appearNote.poll.choices[choice].votes + 1, - ...(body.userId === this.$store.state.i.id ? { - isVoted: true - } : {}) - } - } + choices: choices }; this.updateAppearNote(n);