From fa0a88cc02546d7174e28e6d0fabfc345375c8be Mon Sep 17 00:00:00 2001 From: Chad Curtis Date: Tue, 3 Mar 2026 05:00:24 -0600 Subject: [PATCH] fix: preserve custom background when switching away from custom theme --- src/hooks/useTheme.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts index 4688426b..496d3c33 100644 --- a/src/hooks/useTheme.ts +++ b/src/hooks/useTheme.ts @@ -73,13 +73,10 @@ export function useTheme() { // Re-enable transitions after the browser has painted the new theme requestAnimationFrame(() => noTransition.remove()); - // Update local immediately — also clear any background from customTheme + // Update local immediately — preserve customTheme (including background) so it can be restored updateConfig((currentConfig) => ({ ...currentConfig, theme, - customTheme: currentConfig.customTheme - ? { ...currentConfig.customTheme, background: undefined } - : undefined, })); syncToEncrypted({ theme }); }, [config.themes, config.customTheme?.colors, updateConfig, syncToEncrypted]);