fixed jumpy clock hands when someone joins in the middle of a vote (fixes #49)

This commit is contained in:
Steffen 2020-07-23 10:39:48 +02:00
parent 0f35f009f8
commit fd75b1771f
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
3 changed files with 7 additions and 5 deletions

View File

@ -807,7 +807,7 @@ li.move:not(.from) .player .overlay svg.move {
.player.dead .night em {
color: #ddd;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, gray 100%) ;
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, gray 100%);
}
/***** Reminder token *****/

View File

@ -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.

View File

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