diff --git a/src/components/SettingsView.svelte b/src/components/SettingsView.svelte index 2140f8a..d624745 100644 --- a/src/components/SettingsView.svelte +++ b/src/components/SettingsView.svelte @@ -21,10 +21,12 @@ }) onMount(() => { + if (!$settings.layers) $settings.layers = {} + for (const layer of layerDefinitions) { if (!$settings.layers[layer.name]) { $settings.layers[layer.name] = { - cache: false, + cache: true, } } } diff --git a/src/stores/settings.ts b/src/stores/settings.ts index f4fa6e5..e545fd6 100644 --- a/src/stores/settings.ts +++ b/src/stores/settings.ts @@ -45,6 +45,7 @@ const createStore = () => { // Load settings from disk. loadSettings().then(settings => { + settings = {...defaultValue, ...settings } if (settings) set(settings); resolve(settings)