mirror of https://github.com/bra1n/townsquare.git
fix vote timer (closes #22)
This commit is contained in:
parent
a88cb45fb1
commit
080b1314ad
|
@ -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) {
|
||||||
|
|
|
@ -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 }) {
|
||||||
|
|
Loading…
Reference in New Issue