fix list of locked votes showing unlocked votes sometimes

This commit is contained in:
Steffen 2021-01-06 21:44:56 +01:00
parent bc5aca1a8c
commit 9c3632e2ae
1 changed files with 6 additions and 4 deletions

View File

@ -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);