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() { ...@@ -16,8 +16,12 @@ export default function useCustomTheme() {
const [mode, setMode] = useRecoilState(atomThemeMode); const [mode, setMode] = useRecoilState(atomThemeMode);
useEffect(() => { useEffect(() => {
if (theme_mode !== "system") { const themeMode = ["light", "dark", "system"].includes(theme_mode!)
setMode(theme_mode ?? "light"); ? theme_mode!
: "light";
if (themeMode !== "system") {
setMode(themeMode);
return; 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