Adds mutation key for INITIALIZE_CONFIG

This commit is contained in:
Alicia Sykes 2021-10-17 20:08:38 +01:00
parent 159748e3de
commit 08da96da2d
3 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,7 @@ export default {
},
},
created() {
this.$store.dispatch('initializeConfig');
this.$store.dispatch(Keys.INITIALIZE_CONFIG);
},
methods: {
/* Injects the users custom CSS as a style tag */

View File

@ -9,6 +9,7 @@ import filterUserSections from '@/utils/CheckSectionVisibility';
Vue.use(Vuex);
const {
INITIALIZE_CONFIG,
UPDATE_CONFIG,
SET_MODAL_OPEN,
SET_LANGUAGE,
@ -79,7 +80,7 @@ const store = new Vuex.Store({
},
actions: {
/* Called when app first loaded. Reads config and sets state */
initializeConfig({ commit }) {
[INITIALIZE_CONFIG]({ commit }) {
const Accumulator = new ConfigAccumulator();
const config = Accumulator.config();
commit(UPDATE_CONFIG, config);

View File

@ -1,5 +1,6 @@
// A list of mutation names
const KEY_NAMES = [
'INITIALIZE_CONFIG',
'UPDATE_CONFIG',
'SET_MODAL_OPEN',
'SET_LANGUAGE',