fix: client mode not being detected; chore: added gui dev scripts

This commit is contained in:
Roberto Tonino
2020-09-22 22:40:41 +02:00
parent 3a6577e9a8
commit 30b0881b76
7 changed files with 33 additions and 20 deletions

View File

@@ -6,7 +6,8 @@ const getDefaultState = () => {
id: null,
name: '',
picture: ''
}
},
clientMode: false
}
}
@@ -43,13 +44,16 @@ const actions = {
},
setUser({ commit }, payload) {
commit('SET_USER', payload)
},
setClientMode({ commit }, payload) {
commit('SET_CLIENT_MODE', payload)
}
}
const getters = {
getARL: state => state.arl,
getUser: state => state.user,
// isLoggedIn: state => [1, 2, 3].indexOf(state.status) !== -1
getClientMode: state => state.clientMode,
isLoggedIn: state => !!state.arl
}
@@ -63,6 +67,9 @@ const mutations = {
SET_USER(state, payload) {
state.user = payload
},
SET_CLIENT_MODE(state, payload) {
state.clientMode = payload
},
RESET_LOGIN(state) {
// Needed for reactivity
Object.assign(state, getDefaultState())