mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-20 17:08:32 +08:00
fix: limit theme mode value
This commit is contained in:
1 parent
2ad6c66a8d
commit
5ef23ddc1d
1 file changed
+6
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user