mirror of https://github.com/bra1n/townsquare.git
move block/night logic from socket to menu
This commit is contained in:
parent
946bafec5b
commit
8dacfea0cb
|
@ -116,7 +116,7 @@ export default {
|
|||
break;
|
||||
case "s":
|
||||
if (this.session.isSpectator) return;
|
||||
this.$store.commit("toggleNight");
|
||||
this.$refs.menu.toggleNight();
|
||||
break;
|
||||
case "escape":
|
||||
this.$store.commit("toggleModal");
|
||||
|
|
|
@ -327,12 +327,17 @@ export default {
|
|||
this.$store.dispatch("players/clearRoles");
|
||||
}
|
||||
},
|
||||
toggleNight() {
|
||||
this.$store.commit("toggleNight");
|
||||
if (this.grimoire.isNight) {
|
||||
this.$store.commit("players/setOnBlock", -1);
|
||||
}
|
||||
},
|
||||
...mapMutations([
|
||||
"toggleGrimoire",
|
||||
"toggleMenu",
|
||||
"toggleImageOptIn",
|
||||
"toggleMuted",
|
||||
"toggleNight",
|
||||
"toggleNightOrder",
|
||||
"setZoom",
|
||||
"toggleModal"
|
||||
|
|
|
@ -691,9 +691,6 @@ class LiveSession {
|
|||
setIsNight() {
|
||||
if (this._isSpectator) return;
|
||||
this._send("isNight", this._store.state.grimoire.isNight);
|
||||
if (this._store.state.grimoire.isNight) {
|
||||
this._store.commit("players/setOnBlock", -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue