mirror of https://github.com/bra1n/townsquare.git
fixed jumpy clock hands when someone joins in the middle of a vote (fixes #49)
This commit is contained in:
parent
0f35f009f8
commit
fd75b1771f
|
@ -32,11 +32,11 @@ const mutations = {
|
|||
setPlayerCount: set("playerCount"),
|
||||
setVotingSpeed: set("votingSpeed"),
|
||||
claimSeat: set("claimedSeat"),
|
||||
nomination(state, { nomination, votes, votingSpeed } = {}) {
|
||||
nomination(state, { nomination, votes, votingSpeed, lockedVote } = {}) {
|
||||
state.nomination = nomination || false;
|
||||
state.votes = votes || [];
|
||||
state.votingSpeed = votingSpeed || state.votingSpeed;
|
||||
state.lockedVote = 0;
|
||||
state.lockedVote = lockedVote || 0;
|
||||
},
|
||||
/**
|
||||
* Store a vote with and without syncing it to the live session.
|
||||
|
|
|
@ -183,6 +183,7 @@ class LiveSession {
|
|||
gamestate: this._gamestate,
|
||||
nomination: session.nomination,
|
||||
votingSpeed: session.votingSpeed,
|
||||
lockedVote: session.lockedVote,
|
||||
...(session.nomination ? { votes: session.votes } : {})
|
||||
});
|
||||
}
|
||||
|
@ -194,11 +195,12 @@ class LiveSession {
|
|||
*/
|
||||
_updateGamestate(data) {
|
||||
if (!this._isSpectator) return;
|
||||
const { gamestate, nomination, votingSpeed, votes } = data;
|
||||
const { gamestate, nomination, votingSpeed, votes, lockedVote } = data;
|
||||
this._store.commit("session/nomination", {
|
||||
nomination,
|
||||
votes,
|
||||
votingSpeed
|
||||
votingSpeed,
|
||||
lockedVote
|
||||
});
|
||||
const players = this._store.state.players.players;
|
||||
// adjust number of players
|
||||
|
|
Loading…
Reference in New Issue