From 9c3632e2ae943b2c5f262b8207608ab3211aa15b Mon Sep 17 00:00:00 2001 From: Steffen Date: Wed, 6 Jan 2021 21:44:56 +0100 Subject: [PATCH] fix list of locked votes showing unlocked votes sometimes --- src/components/Vote.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Vote.vue b/src/components/Vote.vue index 3a41e35..905b43b 100644 --- a/src/components/Vote.vue +++ b/src/components/Vote.vue @@ -161,11 +161,13 @@ export default { }, voters: function() { const nomination = this.session.nomination[1]; - const voters = this.session.votes.map((vote, index) => - vote ? this.players[index].name : "" - ); + const voters = Array(this.players.length) + .fill("") + .map((x, index) => + this.session.votes[index] ? this.players[index].name : "" + ); const reorder = [ - ...voters.slice(nomination + 1, this.players.length), + ...voters.slice(nomination + 1), ...voters.slice(0, nomination + 1) ]; return reorder.slice(0, this.session.lockedVote - 1).filter(n => !!n);