🚧 Started working on itnitial state for widgets

This commit is contained in:
Alicia Sykes
2021-11-13 20:30:55 +00:00
parent 1a58d85ccc
commit cd3a304744
2 changed files with 17 additions and 3 deletions

View File

@@ -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(),
};
}
}