mirror of https://github.com/Lissy93/dashy.git
🐛 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
|
* Returns the appConfig section, as JSON
|
||||||
*/
|
*/
|
||||||
export const appConfig = (() => {
|
export const appConfig = (() => {
|
||||||
|
const appConfigFile = conf.appConfig || {};
|
||||||
let usersAppConfig = Defaults.appConfig;
|
let usersAppConfig = Defaults.appConfig;
|
||||||
if (localStorage[localStorageKeys.APP_CONFIG]) {
|
if (localStorage[localStorageKeys.APP_CONFIG]) {
|
||||||
usersAppConfig = JSON.parse(localStorage[localStorageKeys.APP_CONFIG]);
|
usersAppConfig = JSON.parse(localStorage[localStorageKeys.APP_CONFIG]);
|
||||||
} else if (conf.appConfig) {
|
} else if (appConfigFile !== {}) {
|
||||||
usersAppConfig = conf.appConfig;
|
usersAppConfig = appConfigFile;
|
||||||
}
|
}
|
||||||
usersAppConfig.layout = localStorage[localStorageKeys.LAYOUT_ORIENTATION]
|
usersAppConfig.layout = localStorage[localStorageKeys.LAYOUT_ORIENTATION]
|
||||||
|| conf.appConfig.layout || Defaults.layout;
|
|| appConfigFile.layout || Defaults.layout;
|
||||||
usersAppConfig.iconSize = localStorage[localStorageKeys.ICON_SIZE]
|
usersAppConfig.iconSize = localStorage[localStorageKeys.ICON_SIZE]
|
||||||
|| conf.appConfig.iconSize || Defaults.iconSize;
|
|| appConfigFile.iconSize || Defaults.iconSize;
|
||||||
return usersAppConfig;
|
return usersAppConfig;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue