Set $matrix variable inside Vuex store
This commit is contained in:
parent
96ef4885d6
commit
fba172d5cf
2 changed files with 6 additions and 3 deletions
|
|
@ -184,6 +184,9 @@ app.config.globalProperties.$i18n = i18n;
|
||||||
|
|
||||||
app.use(matrix, { store: store, i18n: i18n });
|
app.use(matrix, { store: store, i18n: i18n });
|
||||||
|
|
||||||
|
// Set $matrix inside data store
|
||||||
|
store.$matrix = app.$matrix;
|
||||||
|
|
||||||
if (app.$config.accentColor) {
|
if (app.$config.accentColor) {
|
||||||
app.$vuetify.theme.themes.light.primary = app.$config.accentColor;
|
app.$vuetify.theme.themes.light.primary = app.$config.accentColor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ const store = createStore({
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
login({ commit }, { user, registrationFlowHandler }) {
|
login({ commit }, { user, registrationFlowHandler }) {
|
||||||
return this._vm.$matrix.login(user, registrationFlowHandler).then(
|
return this.$matrix.login(user, registrationFlowHandler).then(
|
||||||
user => {
|
user => {
|
||||||
commit('loginSuccess', user);
|
commit('loginSuccess', user);
|
||||||
return Promise.resolve(user);
|
return Promise.resolve(user);
|
||||||
|
|
@ -116,7 +116,7 @@ const store = createStore({
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
createUser({ commit }, { user, registrationFlowHandler }) {
|
createUser({ commit }, { user, registrationFlowHandler }) {
|
||||||
return this._vm.$matrix.login(user, registrationFlowHandler, true).then(
|
return this.$matrix.login(user, registrationFlowHandler, true).then(
|
||||||
user => {
|
user => {
|
||||||
commit('loginSuccess', user);
|
commit('loginSuccess', user);
|
||||||
return Promise.resolve(user);
|
return Promise.resolve(user);
|
||||||
|
|
@ -128,7 +128,7 @@ const store = createStore({
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
logout({ commit }) {
|
logout({ commit }) {
|
||||||
this._vm.$matrix.logout();
|
this.$matrix.logout();
|
||||||
commit('logout');
|
commit('logout');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue