update window title depending on grimoire mode (closes #2)

This commit is contained in:
Steffen 2020-05-05 20:13:30 +02:00
parent 8bdc2d64eb
commit 46ce385781
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
2 changed files with 10 additions and 7 deletions

View File

@ -48,12 +48,15 @@ export default new Vuex.Store({
toggleMenu({ grimoire }) { toggleMenu({ grimoire }) {
grimoire.isMenuOpen = !grimoire.isMenuOpen; grimoire.isMenuOpen = !grimoire.isMenuOpen;
}, },
toggleGrimoire({ grimoire }) { toggleGrimoire({ grimoire }, isPublic) {
grimoire.isPublic = !grimoire.isPublic; if (isPublic === true || isPublic === false) {
grimoire.isControlOpen = !grimoire.isPublic;
},
showGrimoire({ grimoire }, isPublic = false) {
grimoire.isPublic = isPublic; grimoire.isPublic = isPublic;
} else {
grimoire.isPublic = !grimoire.isPublic;
}
document.title = `Blood on the Clocktower ${
grimoire.isPublic ? "Town Square" : "Grimoire"
}`;
}, },
toggleNightOrder({ grimoire }) { toggleNightOrder({ grimoire }) {
grimoire.isNightOrder = !grimoire.isNightOrder; grimoire.isNightOrder = !grimoire.isNightOrder;

View File

@ -4,7 +4,7 @@ module.exports = store => {
store.commit("setBackground", localStorage.background); store.commit("setBackground", localStorage.background);
} }
if (localStorage.isPublic !== undefined) { if (localStorage.isPublic !== undefined) {
store.commit("showGrimoire", JSON.parse(localStorage.isPublic)); store.commit("toggleGrimoire", JSON.parse(localStorage.isPublic));
} }
if (localStorage.edition !== undefined) { if (localStorage.edition !== undefined) {
// this will initialize state.roles! // this will initialize state.roles!