Skip to content

Commit

Permalink
fix(ui): loaded preset settings are not validated and reset
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMakesGames committed Mar 13, 2024
1 parent 8dd09db commit 793c631
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/src/lib/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
mapSettings,
presetMapSettings,
settingsAreDifferent,
validateAndResetSettings,
type SavedMapSettings,
} from './mapSettings';
import stellarMapsApi, { type StellarisSaveMetadata } from './stellarMapsApi';
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 793c631

Please sign in to comment.