fix vote timer (closes #22)

This commit is contained in:
Steffen 2020-06-07 21:40:04 +02:00
parent a88cb45fb1
commit 080b1314ad
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
2 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,7 @@ export default {
methods: { methods: {
start() { start() {
this.$store.commit("session/lockVote"); this.$store.commit("session/lockVote");
clearInterval(this.voteTimer);
this.voteTimer = setInterval(() => { this.voteTimer = setInterval(() => {
this.$store.commit("session/lockVote"); this.$store.commit("session/lockVote");
if (this.session.lockedVote > this.players.length) { if (this.session.lockedVote > this.players.length) {
@ -93,10 +94,11 @@ export default {
}, 3000); }, 3000);
}, },
stop() { stop() {
this.$store.commit("session/lockVote", 0);
clearInterval(this.voteTimer); clearInterval(this.voteTimer);
this.$store.commit("session/lockVote", 0);
}, },
finish() { finish() {
clearInterval(this.voteTimer);
this.$store.commit("session/nomination", false); this.$store.commit("session/nomination", false);
}, },
vote(vote) { vote(vote) {

View File

@ -176,6 +176,7 @@ class LiveSession {
* Update the gamestate based on incoming data. * Update the gamestate based on incoming data.
* @param gamestate * @param gamestate
* @param edition * @param edition
* @param nomination
* @private * @private
*/ */
_updateGamestate({ gamestate, edition, nomination }) { _updateGamestate({ gamestate, edition, nomination }) {