fix(preferences): use Object.assign mutation to prevent infinite effect loops

Replacing the preferences object (spread reassignment) caused all consumers'
prefs references to go stale — the loop guard read the old value forever.
Svelte 5 shared state pattern requires a stable const object with property
mutations, not reassignment. Also removes duplicate theme sync $effect from
SettingsPage (already handled in +layout.svelte).
This commit is contained in:
2026-04-18 10:18:29 +01:00
parent 61c96d7805
commit e436a69839
2 changed files with 6 additions and 14 deletions

View File

@@ -281,14 +281,6 @@
saveSettings();
});
// Sync theme setting to preferences store
$effect(() => {
const map = { Dark: 'dark', Light: 'light', System: 'system' };
const mapped = map[settings.theme] || 'dark';
if (prefs.theme !== mapped) {
updatePreferences({ theme: mapped });
}
});
$effect(() => {
settings.engine;