export const state = () => ({ json: {}, version: -1, user: undefined, gameinfo: undefined, games: undefined, }) export const mutations = { setJson(state, json) { state.json = json state.version = parseInt(json.version, 10) }, setVersion(state, version) { state.version = version }, setUser(state, user) { state.user = user if (user) { this.$i18n.setLang(user.lang) } }, setGameInfo(state, gameinfo) { state.gameinfo = gameinfo }, setGames(state, games) { state.games = games } }