Put invitesDisabled in app state

This commit is contained in:
Angelina Filippova 2020-04-05 03:25:01 +03:00
parent d8cff84bf5
commit 3314a0eace
2 changed files with 10 additions and 2 deletions

View file

@ -8,7 +8,8 @@ const app = {
},
device: 'desktop',
language: Cookies.get('language') || 'en',
size: Cookies.get('size') || 'medium'
size: Cookies.get('size') || 'medium',
invitesEnabled: false
},
mutations: {
TOGGLE_SIDEBAR: state => {
@ -28,6 +29,9 @@ const app = {
TOGGLE_DEVICE: (state, device) => {
state.device = device
},
SET_INVITES_ENABLED: (state, invitesEnabled) => {
state.invitesEnabled = invitesEnabled
},
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
@ -47,6 +51,9 @@ const app = {
toggleDevice({ commit }, device) {
commit('TOGGLE_DEVICE', device)
},
SetInvitesEnabled({ commit }, invitesEnabled) {
commit('SET_INVITES_ENABLED', invitesEnabled)
},
setLanguage({ commit }, language) {
commit('SET_LANGUAGE', language)
},

View file

@ -72,10 +72,11 @@ const user = {
})
})
},
async GetNodeInfo({ commit, state }) {
async GetNodeInfo({ commit, dispatch, state }) {
const nodeInfo = await getNodeInfo(state.authHost)
commit('SET_NODE_INFO', nodeInfo.data)
dispatch('SetInvitesEnabled', nodeInfo.data.metadata.invitesEnabled)
},
GetUserInfo({ commit, state }) {
return new Promise((resolve, reject) => {