From 793c631963f245583757db3317121b66e0381554 Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Tue, 12 Mar 2024 19:49:37 -0500 Subject: [PATCH] fix(ui): loaded preset settings are not validated and reset --- src/renderer/src/lib/Sidebar.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/lib/Sidebar.svelte b/src/renderer/src/lib/Sidebar.svelte index ae60ea5..8a8f1f6 100644 --- a/src/renderer/src/lib/Sidebar.svelte +++ b/src/renderer/src/lib/Sidebar.svelte @@ -24,6 +24,7 @@ mapSettings, presetMapSettings, settingsAreDifferent, + validateAndResetSettings, type SavedMapSettings, } from './mapSettings'; import stellarMapsApi, { type StellarisSaveMetadata } from './stellarMapsApi'; @@ -78,9 +79,10 @@ if (confirmed) { loadedSettingsKey.set(`${type}|${savedSettings.name}`); if (settingsAreDifferent(savedSettings.settings, $mapSettings)) { - editedMapSettings.set(savedSettings.settings); - mapSettings.set(savedSettings.settings); - lastProcessedMapSettings.set(savedSettings.settings); + const validated = validateAndResetSettings(savedSettings.settings); + editedMapSettings.set(validated); + mapSettings.set(validated); + lastProcessedMapSettings.set(validated); } } }