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!

add goToLinkEnabled to appConfig with Vuex getter and mutation for search bar toggle support

Wu Baiyang (Student)345a95d785a0
diff --git a/src/store.js b/src/store.js
index c725ba3a..edf86265 100644
--- a/src/store.js
+++ b/src/store.js
@@ -73,6 +73,10 @@ const store = new Vuex.Store({
if (!state.config) return {};
return state.config.appConfig || {};
},
+ goToLinkEnabled(state, getters) {
+ // Default to true if not set
+ return typeof getters.appConfig.goToLinkEnabled === 'boolean' ? getters.appConfig.goToLinkEnabled : true;
+ },
sections(state) {
return filterUserSections(state.config.sections || []);
},
@@ -237,6 +241,11 @@ const store = new Vuex.Store({
if (!state.config.appConfig) state.config.appConfig = {};
state.config.appConfig.disableWebSearch = value;
},
+ // Dynamically update goToLinkEnabled in appConfig
+ setGoToLinkEnabled(state, value) {
+ if (!state.config.appConfig) state.config.appConfig = {};
+ state.config.appConfig.goToLinkEnabled = value;
+ },
[UPDATE_SECTION](state, payload) {
const { sectionIndex, sectionData } = payload;
const newConfig = { ...state.config };