From f0c09cf497650f16b832a1bd636c1f8ef373bbd2 Mon Sep 17 00:00:00 2001 From: Steffen Date: Sun, 14 Mar 2021 20:41:56 +0100 Subject: [PATCH] fix (pre-)vote calculation being off by one if the nominee votes (fixes #131) --- src/components/Vote.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/Vote.vue b/src/components/Vote.vue index 0c91994..4bdd242 100644 --- a/src/components/Vote.vue +++ b/src/components/Vote.vue @@ -10,17 +10,14 @@ {{ nominee.name }}!
- - + + {{ voters.length }} vote{{ voters.length !== 1 ? "s" : "" }} + + in favor + + (majority is {{ Math.ceil(alive / 2) }}) + + (majority is {{ Math.ceil(players.length / 2) }})
{{ voters.join(", ") }} @@ -170,7 +167,10 @@ export default { ...voters.slice(nomination + 1), ...voters.slice(0, nomination + 1) ]; - return reorder.slice(0, this.session.lockedVote - 1).filter(n => !!n); + return (this.session.lockedVote + ? reorder.slice(0, this.session.lockedVote - 1) + : reorder + ).filter(n => !!n); } }, data() {