fix(client): Reactivate poll

This commit is contained in:
syuilo 2020-07-31 19:09:38 +09:00
parent c6837b9fdf
commit 2522e7388d
1 changed files with 10 additions and 10 deletions

View File

@ -406,18 +406,18 @@ export default Vue.extend({
...this.appearNote, ...this.appearNote,
}; };
n.poll = { const choices = [...this.appearNote.poll.choices];
...this.appearNote.poll, choices[choice] = {
choices: { ...choices[choice],
...this.appearNote.poll.choices, votes: choices[choice].votes + 1,
[choice]: {
...this.appearNote.poll.choices[choice],
votes: this.appearNote.poll.choices[choice].votes + 1,
...(body.userId === this.$store.state.i.id ? { ...(body.userId === this.$store.state.i.id ? {
isVoted: true isVoted: true
} : {}) } : {})
} };
}
n.poll = {
...this.appearNote.poll,
choices: choices
}; };
this.updateAppearNote(n); this.updateAppearNote(n);