Add a resetState mutation
This commit is contained in:
parent
bf4f5c878e
commit
c4ffdbb5bc
1 changed files with 11 additions and 0 deletions
|
|
@ -63,6 +63,17 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
resetState(state) {
|
||||||
|
state.view = `login`;
|
||||||
|
state.role = null;
|
||||||
|
state.team = null;
|
||||||
|
state.name = ``;
|
||||||
|
state.is_host = false;
|
||||||
|
state.chosen_object = null;
|
||||||
|
state.questions = [];
|
||||||
|
state.game_code = null;
|
||||||
|
state.players = [];
|
||||||
|
},
|
||||||
player(state, data) {
|
player(state, data) {
|
||||||
if (data.name)
|
if (data.name)
|
||||||
state.name = data.name
|
state.name = data.name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue