mirror of https://github.com/bra1n/townsquare.git
fix (pre-)vote calculation being off by one if the nominee votes (fixes #131)
This commit is contained in:
parent
a849001068
commit
f0c09cf497
|
@ -10,17 +10,14 @@
|
||||||
<em>{{ nominee.name }}</em
|
<em>{{ nominee.name }}</em
|
||||||
>!
|
>!
|
||||||
<br />
|
<br />
|
||||||
<template v-if="nominee.role.team !== 'traveler'">
|
<em class="blue">
|
||||||
<em class="blue">
|
{{ voters.length }} vote{{ voters.length !== 1 ? "s" : "" }}
|
||||||
{{ voters.length }} vote{{ voters.length !== 1 ? "s" : "" }}
|
</em>
|
||||||
</em>
|
in favor
|
||||||
in favor
|
<em v-if="nominee.role.team !== 'traveler'">
|
||||||
<em>(majority is {{ Math.ceil(alive / 2) }})</em>
|
(majority is {{ Math.ceil(alive / 2) }})
|
||||||
</template>
|
</em>
|
||||||
<template v-else>
|
<em v-else>(majority is {{ Math.ceil(players.length / 2) }})</em>
|
||||||
<em>{{ Math.ceil(players.length / 2) }} votes</em> required for a
|
|
||||||
<em>majority</em>.
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<div v-if="session.isVoteInProgress || session.lockedVote > 1">
|
<div v-if="session.isVoteInProgress || session.lockedVote > 1">
|
||||||
<em class="blue" v-if="voters.length">{{ voters.join(", ") }} </em>
|
<em class="blue" v-if="voters.length">{{ voters.join(", ") }} </em>
|
||||||
|
@ -170,7 +167,10 @@ export default {
|
||||||
...voters.slice(nomination + 1),
|
...voters.slice(nomination + 1),
|
||||||
...voters.slice(0, 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() {
|
data() {
|
||||||
|
|
Loading…
Reference in New Issue