Fix system title bar sync only propagating true values

The localStorage->backend sync only ran when useSystemTitleBar was true,
so toggling it OFF never persisted to the database. On restart, the
backend read the old 'true' value and created the window with system
decorations, while the UI showed 'false' from localStorage.

Now syncs the value unconditionally on init.
This commit is contained in:
vicrodh committed 2026-02-12 13:56:33 -06:00
1 parent 348e615d41
commit 901b0edab8
1 file changed
+4 -5
+4 -5
View File
@@ -43,11 +43,10 @@ export function initTitleBarStore(): void {
// Sync localStorage value to Rust backend so it's available at next
// startup (before window creation). Handles migration from the
// localStorage-only era and keeps both stores in sync.
if (useSystemTitleBar) {
invoke('set_use_system_titlebar', { value: true }).catch((e) => {
console.error('[TitleBarStore] Failed to sync system titlebar to backend:', e);
});
}
// Always sync, not just when true - otherwise false values never propagate.
invoke('set_use_system_titlebar', { value: useSystemTitleBar }).catch((e) => {
console.error('[TitleBarStore] Failed to sync system titlebar to backend:', e);
});
} catch (e) {
console.error('[TitleBarStore] Failed to initialize:', e);
}