forked from AkkomaGang/admin-fe
Put invitesDisabled in app state
This commit is contained in:
parent
d8cff84bf5
commit
3314a0eace
2 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,8 @@ const app = {
|
||||||
},
|
},
|
||||||
device: 'desktop',
|
device: 'desktop',
|
||||||
language: Cookies.get('language') || 'en',
|
language: Cookies.get('language') || 'en',
|
||||||
size: Cookies.get('size') || 'medium'
|
size: Cookies.get('size') || 'medium',
|
||||||
|
invitesEnabled: false
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
TOGGLE_SIDEBAR: state => {
|
TOGGLE_SIDEBAR: state => {
|
||||||
|
@ -28,6 +29,9 @@ const app = {
|
||||||
TOGGLE_DEVICE: (state, device) => {
|
TOGGLE_DEVICE: (state, device) => {
|
||||||
state.device = device
|
state.device = device
|
||||||
},
|
},
|
||||||
|
SET_INVITES_ENABLED: (state, invitesEnabled) => {
|
||||||
|
state.invitesEnabled = invitesEnabled
|
||||||
|
},
|
||||||
SET_LANGUAGE: (state, language) => {
|
SET_LANGUAGE: (state, language) => {
|
||||||
state.language = language
|
state.language = language
|
||||||
Cookies.set('language', language)
|
Cookies.set('language', language)
|
||||||
|
@ -47,6 +51,9 @@ const app = {
|
||||||
toggleDevice({ commit }, device) {
|
toggleDevice({ commit }, device) {
|
||||||
commit('TOGGLE_DEVICE', device)
|
commit('TOGGLE_DEVICE', device)
|
||||||
},
|
},
|
||||||
|
SetInvitesEnabled({ commit }, invitesEnabled) {
|
||||||
|
commit('SET_INVITES_ENABLED', invitesEnabled)
|
||||||
|
},
|
||||||
setLanguage({ commit }, language) {
|
setLanguage({ commit }, language) {
|
||||||
commit('SET_LANGUAGE', language)
|
commit('SET_LANGUAGE', language)
|
||||||
},
|
},
|
||||||
|
|
|
@ -72,10 +72,11 @@ const user = {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async GetNodeInfo({ commit, state }) {
|
async GetNodeInfo({ commit, dispatch, state }) {
|
||||||
const nodeInfo = await getNodeInfo(state.authHost)
|
const nodeInfo = await getNodeInfo(state.authHost)
|
||||||
|
|
||||||
commit('SET_NODE_INFO', nodeInfo.data)
|
commit('SET_NODE_INFO', nodeInfo.data)
|
||||||
|
dispatch('SetInvitesEnabled', nodeInfo.data.metadata.invitesEnabled)
|
||||||
},
|
},
|
||||||
GetUserInfo({ commit, state }) {
|
GetUserInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
Loading…
Reference in a new issue