fix(updates): ensure preferences are loaded from backend after login
initUpdatesStore() set its initialized flag before the async preference fetch completed. If get_update_preferences failed (backend store not yet ready), preferences stayed at defaults (both true) and were never re-fetched. This caused: - "Show What's New" toggle appearing enabled despite being disabled - "Check for updates on launch" toggle not persisting - Changelog modal reappearing on every restart Changes: - Split initialized flag into versionLoaded/prefsLoaded so preference loading retries until the backend store is ready - Call refreshUpdatePreferences() in decideLaunchModals() to always get fresh data before making modal decisions - Call refreshUpdatePreferences() in handleLoginSuccess() after session activation so SettingsView reflects saved values cc
This commit is contained in:
1 parent
865e25e9b1
commit
28742fa19e
3 files changed
+27
-15
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
ignoreRelease,
|
||||
initUpdatesStore,
|
||||
markWhatsNewShown,
|
||||
refreshUpdatePreferences,
|
||||
setCheckOnLaunch,
|
||||
} from '$lib/stores/updatesStore';
|
||||
import type { ReleaseInfo } from '$lib/stores/updatesStore';
|
||||
@@ -175,6 +176,10 @@ export async function decideLaunchModals(): Promise<LaunchUpdateDecision> {
|
||||
ensureSessionId();
|
||||
|
||||
await initUpdatesStore();
|
||||
// Always refresh preferences from the backend to ensure we have
|
||||
// the user's saved settings (initUpdatesStore may have loaded
|
||||
// defaults if the session wasn't ready on first call).
|
||||
await refreshUpdatePreferences();
|
||||
const prefs = getPreferences();
|
||||
const currentVersion = getCurrentVersion();
|
||||
|
||||
|
||||
Reference in new issue
Block a user