Skip to content
Snippets Groups Projects
Unverified Commit c1734a09 authored by GyDi's avatar GyDi
Browse files

fix: limit theme mode value

parent 99c46685
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,12 @@ export default function useCustomTheme() {
const [mode, setMode] = useRecoilState(atomThemeMode);
useEffect(() => {
if (theme_mode !== "system") {
setMode(theme_mode ?? "light");
const themeMode = ["light", "dark", "system"].includes(theme_mode!)
? theme_mode!
: "light";
if (themeMode !== "system") {
setMode(themeMode);
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment