mirror of https://github.com/Lissy93/dashy.git
🚧 Started working on itnitial state for widgets
This commit is contained in:
parent
1a58d85ccc
commit
cd3a304744
|
@ -51,12 +51,15 @@ const store = new Vuex.Store({
|
|||
appConfig(state) {
|
||||
return state.config.appConfig || {};
|
||||
},
|
||||
theme(state) {
|
||||
return state.config.appConfig.theme;
|
||||
},
|
||||
sections(state) {
|
||||
return filterUserSections(state.config.sections || []);
|
||||
},
|
||||
widgets(state) {
|
||||
return state.config.widgets || [];
|
||||
},
|
||||
theme(state) {
|
||||
return state.config.appConfig.theme;
|
||||
},
|
||||
webSearch(state, getters) {
|
||||
return getters.appConfig.webSearch || {};
|
||||
},
|
||||
|
|
|
@ -78,12 +78,23 @@ export default class ConfigAccumulator {
|
|||
return sections;
|
||||
}
|
||||
|
||||
/* Widgets */
|
||||
widgets() {
|
||||
const localWidgets = localStorage[localStorageKeys.CONF_WIDGETS];
|
||||
if (localWidgets) {
|
||||
const json = JSON.parse(localWidgets);
|
||||
if (json.length >= 1) return json;
|
||||
}
|
||||
return this.conf.widgets || [];
|
||||
}
|
||||
|
||||
/* Complete config */
|
||||
config() {
|
||||
return {
|
||||
appConfig: this.appConfig(),
|
||||
pageInfo: this.pageInfo(),
|
||||
sections: this.sections(),
|
||||
widgets: this.widgets(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue