From b8e0c18c53fa584ed5e0dadaf4cff38bd6ff9f82 Mon Sep 17 00:00:00 2001 From: Shirone Date: Tue, 6 Jan 2026 02:00:41 +0100 Subject: [PATCH] fix: theme switch bug - when user had set up theme on the project lvl i and went trought the setup wizard again and changed theme its was not updating because its was only updating global theme and app was reverting back to show current project theme --- .../src/components/views/setup-view/steps/theme-step.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/components/views/setup-view/steps/theme-step.tsx b/apps/ui/src/components/views/setup-view/steps/theme-step.tsx index 835678ef..2698ca7c 100644 --- a/apps/ui/src/components/views/setup-view/steps/theme-step.tsx +++ b/apps/ui/src/components/views/setup-view/steps/theme-step.tsx @@ -11,7 +11,7 @@ interface ThemeStepProps { } export function ThemeStep({ onNext, onBack }: ThemeStepProps) { - const { theme, setTheme, setPreviewTheme } = useAppStore(); + const { theme, setTheme, setPreviewTheme, currentProject, setProjectTheme } = useAppStore(); const [activeTab, setActiveTab] = useState<'dark' | 'light'>('dark'); const handleThemeHover = (themeValue: string) => { @@ -24,6 +24,11 @@ export function ThemeStep({ onNext, onBack }: ThemeStepProps) { const handleThemeClick = (themeValue: string) => { setTheme(themeValue as typeof theme); + // Also update the current project's theme if one exists + // This ensures the selected theme is visible since getEffectiveTheme() prioritizes project theme + if (currentProject) { + setProjectTheme(currentProject.id, themeValue as typeof theme); + } setPreviewTheme(null); };