Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:zap: Adds VueX store state for modal open state

Alicia Sykes8d111a162344
diff --git a/src/store.js b/src/store.js
index 2229c6ce..8e260a9f 100644
--- a/src/store.js
+++ b/src/store.js
@@ -4,14 +4,16 @@ import Vuex from 'vuex';
import Keys from '@/utils/StoreMutations';
import ConfigAccumulator from '@/utils/ConfigAccumalator';
import { componentVisibility } from '@/utils/ConfigHelpers';
+import filterUserSections from '@/utils/CheckSectionVisibility';
Vue.use(Vuex);
-const { UPDATE_CONFIG } = Keys;
+const { UPDATE_CONFIG, SET_MODAL_OPEN } = Keys;
const store = new Vuex.Store({
state: {
config: {},
+ modalOpen: false, // KB shortcut functionality will be disabled when modal is open
},
getters: {
config(state) {
@@ -24,7 +26,7 @@ const store = new Vuex.Store({
return state.config.appConfig || {};
},
sections(state) {
- return state.config.sections || [];
+ return filterUserSections(state.config.sections || []);
},
webSearch(state, getters) {
return getters.appConfig.webSearch || {};
@@ -37,6 +39,9 @@ const store = new Vuex.Store({
[UPDATE_CONFIG](state, config) {
state.config = config;
},
+ [SET_MODAL_OPEN](state, modalOpen) {
+ state.modalOpen = modalOpen;
+ },
},
actions: {
initializeConfig({ commit }) {
diff --git a/src/utils/StoreMutations.js b/src/utils/StoreMutations.js
index 1348ca81..4e220880 100644
--- a/src/utils/StoreMutations.js
+++ b/src/utils/StoreMutations.js
@@ -1,6 +1,7 @@
// A list of mutation names
const KEY_NAMES = [
'UPDATE_CONFIG',
+ 'SET_MODAL_OPEN',
];
// Convert array of key names into an object, and export