mirror of https://github.com/bra1n/townsquare.git
fix bluffs not being cleared
This commit is contained in:
parent
2ceee0421b
commit
c8d71e7454
|
@ -153,13 +153,14 @@ export default {
|
|||
if (this.grimoire.isSpectator) return;
|
||||
if (confirm("Are you sure you want to remove all players?")) {
|
||||
this.$store.commit("players/clear");
|
||||
this.$store.commit("setBluff");
|
||||
}
|
||||
},
|
||||
clearRoles() {
|
||||
if (this.grimoire.isSpectator) return;
|
||||
this.$store.commit("showGrimoire");
|
||||
if (confirm("Are you sure you want to remove all player roles?")) {
|
||||
this.$store.dispatch("players/clearRoles");
|
||||
this.$store.commit("setBluff");
|
||||
}
|
||||
},
|
||||
...mapMutations([
|
||||
|
|
|
@ -35,6 +35,8 @@ export default new Vuex.Store({
|
|||
zoom: 1,
|
||||
background: "",
|
||||
bluffs: [],
|
||||
},
|
||||
session: {
|
||||
sessionId: "",
|
||||
isSpectator: false
|
||||
},
|
||||
|
@ -76,8 +78,12 @@ export default new Vuex.Store({
|
|||
setSpectator({ grimoire }, spectator) {
|
||||
grimoire.isSpectator = spectator;
|
||||
},
|
||||
setBluff({ grimoire }, { index, role }) {
|
||||
grimoire.bluffs.splice(index, 1, role);
|
||||
setBluff({ grimoire }, { index, role } = {}) {
|
||||
if (index !== undefined) {
|
||||
grimoire.bluffs.splice(index, 1, role);
|
||||
} else {
|
||||
grimoire.bluffs = [];
|
||||
}
|
||||
},
|
||||
toggleModal({ modals }, name) {
|
||||
modals[name] = !modals[name];
|
||||
|
|
|
@ -32,7 +32,6 @@ module.exports = store => {
|
|||
store.subscribe(({ type, payload }, state) => {
|
||||
switch (type) {
|
||||
case "toggleGrimoire":
|
||||
case "showGrimoire":
|
||||
localStorage.setItem(
|
||||
"isPublic",
|
||||
JSON.stringify(state.grimoire.isPublic)
|
||||
|
|
Loading…
Reference in New Issue