bug(ui) fix flicker refreshing background color (#19041)

This commit is contained in:
Jacob Richman
2026-02-13 15:33:02 -08:00
committed by GitHub
parent 9df604b01b
commit 401bef1d2b
6 changed files with 55 additions and 29 deletions

View File

@@ -31,6 +31,7 @@ export const useThemeCommand = (
setThemeError: (error: string | null) => void,
addItem: UseHistoryManagerReturn['addItem'],
initialThemeError: string | null,
refreshStatic: () => void,
): UseThemeCommandReturn => {
const [isThemeDialogOpen, setIsThemeDialogOpen] =
useState(!!initialThemeError);
@@ -102,12 +103,13 @@ export const useThemeCommand = (
themeManager.loadCustomThemes(loadedSettings.merged.ui.customThemes);
}
applyTheme(loadedSettings.merged.ui.theme); // Apply the current theme
refreshStatic();
setThemeError(null);
} finally {
setIsThemeDialogOpen(false); // Close the dialog
}
},
[applyTheme, loadedSettings, setThemeError],
[applyTheme, loadedSettings, refreshStatic, setThemeError],
);
return {