From 3df1218ebbb93739830fce7133aae3f22a1cbdb8 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 1 Jan 2021 12:55:36 -0700 Subject: [PATCH] Add mutations that we'll need so vuex-persist actually works --- web/src/store/index.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/web/src/store/index.js b/web/src/store/index.js index 5672dcb..41e1885 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -59,9 +59,25 @@ export default new Vuex.Store({ return state[`team_${3 - state.team}`].name; }; return ``; - } + }, }, mutations: { + player(state, data) { + if (data.name) + state.name = data.name + if (data.role) + state.role = data.role + if (data.team) + state.team = data.team + if (data.host) + state.is_host = data.host + }, + game_code(state, game_code) { + state.game_code = game_code; + }, + view(state, target) { + state.view = target; + }, }, actions: { },