diff --git a/src/store/index.js b/src/store/index.js index 91374a2..e5991cf 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -48,12 +48,15 @@ export default new Vuex.Store({ toggleMenu({ grimoire }) { grimoire.isMenuOpen = !grimoire.isMenuOpen; }, - toggleGrimoire({ grimoire }) { - grimoire.isPublic = !grimoire.isPublic; - grimoire.isControlOpen = !grimoire.isPublic; - }, - showGrimoire({ grimoire }, isPublic = false) { - grimoire.isPublic = isPublic; + toggleGrimoire({ grimoire }, isPublic) { + if (isPublic === true || isPublic === false) { + grimoire.isPublic = isPublic; + } else { + grimoire.isPublic = !grimoire.isPublic; + } + document.title = `Blood on the Clocktower ${ + grimoire.isPublic ? "Town Square" : "Grimoire" + }`; }, toggleNightOrder({ grimoire }) { grimoire.isNightOrder = !grimoire.isNightOrder; diff --git a/src/store/persistence.js b/src/store/persistence.js index 7fcf3fe..1ae71f0 100644 --- a/src/store/persistence.js +++ b/src/store/persistence.js @@ -4,7 +4,7 @@ module.exports = store => { store.commit("setBackground", localStorage.background); } if (localStorage.isPublic !== undefined) { - store.commit("showGrimoire", JSON.parse(localStorage.isPublic)); + store.commit("toggleGrimoire", JSON.parse(localStorage.isPublic)); } if (localStorage.edition !== undefined) { // this will initialize state.roles!