mirror of
https://github.com/Lissy93/dashy.git
synced 2024-11-23 21:23:28 +03:00
🐛 Fix issue being thrown when appConfig is undefined
This commit is contained in:
parent
5d42d83c63
commit
23e14662e5
@ -11,16 +11,17 @@ import conf from '../../public/conf.yml';
|
||||
* Returns the appConfig section, as JSON
|
||||
*/
|
||||
export const appConfig = (() => {
|
||||
const appConfigFile = conf.appConfig || {};
|
||||
let usersAppConfig = Defaults.appConfig;
|
||||
if (localStorage[localStorageKeys.APP_CONFIG]) {
|
||||
usersAppConfig = JSON.parse(localStorage[localStorageKeys.APP_CONFIG]);
|
||||
} else if (conf.appConfig) {
|
||||
usersAppConfig = conf.appConfig;
|
||||
} else if (appConfigFile !== {}) {
|
||||
usersAppConfig = appConfigFile;
|
||||
}
|
||||
usersAppConfig.layout = localStorage[localStorageKeys.LAYOUT_ORIENTATION]
|
||||
|| conf.appConfig.layout || Defaults.layout;
|
||||
|| appConfigFile.layout || Defaults.layout;
|
||||
usersAppConfig.iconSize = localStorage[localStorageKeys.ICON_SIZE]
|
||||
|| conf.appConfig.iconSize || Defaults.iconSize;
|
||||
|| appConfigFile.iconSize || Defaults.iconSize;
|
||||
return usersAppConfig;
|
||||
})();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user