fix(settings): include current mode in fallback availableModes

When v2_available_titlebar_modes fails, the dropdown's selected value
may not appear in its options. Include the user's current titlebarMode
in the fallback list to ensure the selected value is always present.

cc
This commit is contained in:
vicrodh committed 2026-05-03 20:09:49 -06:00
1 parent b7c686e99c
commit d69c67ad34
1 file changed
+6 -1
+6 -1
View File
@@ -1006,7 +1006,12 @@
// Title bar settings
let titlebarMode = $state<TitlebarMode>(getMode());
let availableModes = $state<TitlebarMode[]>(['qbz', 'system', 'hidden']);
// Fallback list before v2_available_titlebar_modes resolves. Always include
// the currently active mode so the dropdown shows the user's selected value
// even when the backend invoke fails.
let availableModes = $state<TitlebarMode[]>(
titlebarMode === 'plasma' ? ['qbz', 'system', 'plasma', 'hidden'] : ['qbz', 'system', 'hidden']
);
let isSandboxed = $state(false);
let matchSystemWindowChromeState = $state(getMatchSystemWindowChrome());
let windowControlsVisible = $state(getShowWindowControls());