From c4ffdbb5bcf1aa8c3345ec60883bcc3f5ce78914 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 1 Jan 2021 23:25:07 -0700 Subject: [PATCH] Add a resetState mutation --- web/src/store/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/src/store/index.js b/web/src/store/index.js index ac692d2..636de25 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -63,6 +63,17 @@ export default new Vuex.Store({ }, }, 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) { if (data.name) state.name = data.name