routing improved, settings initialized

This commit is contained in:
Torsten Schulz
2024-07-21 18:47:45 +02:00
parent 12d66d6f9c
commit cd0699f3fd
23 changed files with 476 additions and 69 deletions

View File

@@ -1,6 +1,7 @@
import { createStore } from 'vuex';
import dialogs from './modules/dialogs';
import loadMenu from '../utils/menuLoader.js';
import router from '../router';
const store = createStore({
state: {
@@ -43,13 +44,14 @@ const store = createStore({
}
},
actions: {
async login({ commit, dispatch }, user) { // Dispatch hinzufügen
async login({ commit, dispatch }, user) {
commit('dologin', user);
await dispatch('loadMenu'); // Korrekte Verwendung von dispatch
await dispatch('loadMenu');
dispatch('startMenuReload');
},
logout({ commit }) {
commit('dologout');
router.push('/');
},
loadLoginState({ commit }) {
commit('loadLoginState');
@@ -69,7 +71,7 @@ const store = createStore({
startMenuReload({ dispatch }) {
setInterval(() => {
dispatch('loadMenu');
}, 5000);
}, 10000);
},
},
getters: {