mirror of
https://github.com/bra1n/townsquare.git
synced 2025-04-04 22:24:36 +00:00
add persistence when ST for vote speed and vote history allowed
This commit is contained in:
parent
b73de453a5
commit
a4655663dd
2 changed files with 24 additions and 1 deletions
|
@ -4,8 +4,9 @@
|
|||
- add vue linter
|
||||
- use "Exile" rather than "Banishment" for exiles
|
||||
- added global animation toggle for better performance
|
||||
- added record vote history toggle to session menu, and clear vote history button
|
||||
- add support for custom Fabled characters
|
||||
- add storyteller choice to allow player vote history
|
||||
- add persistence for vote speed and vote history allowed, when storyteller
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -68,6 +68,18 @@ module.exports = store => {
|
|||
store.commit("session/setSpectator", spectator);
|
||||
store.commit("session/setSessionId", sessionId);
|
||||
}
|
||||
if (localStorage.getItem("votingSpeed")) {
|
||||
store.commit(
|
||||
"session/setVotingSpeed",
|
||||
parseInt(localStorage.getItem("votingSpeed"))
|
||||
);
|
||||
}
|
||||
if (localStorage.getItem("isVoteHistoryAllowed") !== undefined) {
|
||||
store.commit(
|
||||
"session/setVoteHistoryAllowed",
|
||||
JSON.parse(localStorage.getItem("isVoteHistoryAllowed"))
|
||||
);
|
||||
}
|
||||
|
||||
// listen to mutations
|
||||
store.subscribe(({ type, payload }, state) => {
|
||||
|
@ -183,6 +195,16 @@ module.exports = store => {
|
|||
localStorage.removeItem("playerId");
|
||||
}
|
||||
break;
|
||||
case "session/setVotingSpeed":
|
||||
if (payload && !state.session.isSpectator) {
|
||||
localStorage.setItem("votingSpeed", payload);
|
||||
}
|
||||
break;
|
||||
case "session/setVoteHistoryAllowed":
|
||||
if (payload !== undefined && !state.session.isSpectator) {
|
||||
localStorage.setItem("isVoteHistoryAllowed", payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue