mirror of
https://github.com/BrenBroZAYT/dashy.git
synced 2026-06-15 08:15:37 +00:00
🐛 Fixes theme not updated (#774)
This commit is contained in:
+2
-8
@@ -71,7 +71,7 @@ const store = new Vuex.Store({
|
||||
return state.remoteConfig.pages || [];
|
||||
},
|
||||
theme(state) {
|
||||
return state.config.appConfig.theme;
|
||||
return localStorage[localStorageKeys.THEME] || state.config.appConfig.theme;
|
||||
},
|
||||
webSearch(state, getters) {
|
||||
return getters.appConfig.webSearch || {};
|
||||
@@ -272,6 +272,7 @@ const store = new Vuex.Store({
|
||||
const newConfig = { ...state.config };
|
||||
newConfig.appConfig.theme = theme;
|
||||
state.config = newConfig;
|
||||
localStorage.setItem(localStorageKeys.THEME, theme);
|
||||
InfoHandler('Theme updated', InfoKeys.VISUAL);
|
||||
},
|
||||
[SET_CUSTOM_COLORS](state, customColors) {
|
||||
@@ -318,13 +319,6 @@ const store = new Vuex.Store({
|
||||
commit(SET_REMOTE_CONFIG, yaml.load((await axios.get('/conf.yml')).data));
|
||||
const deepCopy = (json) => JSON.parse(JSON.stringify(json));
|
||||
const config = deepCopy(new ConfigAccumulator().config());
|
||||
if (config.appConfig?.theme) {
|
||||
// Save theme defined in conf.yml as primary
|
||||
localStorage.setItem(localStorageKeys.PRIMARY_THEME, config.appConfig.theme);
|
||||
// This will set theme back to primary in case we were on a themed page
|
||||
// and the index page is loaded w/o navigation (e.g. modifying browser location)
|
||||
localStorage.setItem(localStorageKeys.THEME, config.appConfig.theme);
|
||||
}
|
||||
commit(SET_CONFIG, config);
|
||||
},
|
||||
/* Fetch config for a sub-page (sections and pageInfo only) */
|
||||
|
||||
Reference in New Issue
Block a user