diff --git a/frontend/src/components/ui/theme-provider.tsx b/frontend/src/components/ui/theme-provider.tsx index bb897bf9..d9be4651 100644 --- a/frontend/src/components/ui/theme-provider.tsx +++ b/frontend/src/components/ui/theme-provider.tsx @@ -35,7 +35,8 @@ export function ThemeProvider({ ...props }: ThemeProviderProps) { const [theme, setTheme] = useState(() => { - return (localStorage.getItem(storageKey) as Theme) || defaultTheme; + const themeFromStorage = localStorage.getItem(storageKey) as Theme; + return Themes.includes(themeFromStorage) ? themeFromStorage : defaultTheme; }); const [darkMode, setDarkMode] = useState(() => {