mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
fix auto theme
This commit is contained in:
parent
2b0433ec41
commit
7e0f58d79d
@ -63,15 +63,14 @@ const App: React.FC = () => {
|
|||||||
}, [siderOrder])
|
}, [siderOrder])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTheme(appTheme)
|
|
||||||
if (appTheme === 'system') {
|
|
||||||
setNativeTheme('system')
|
|
||||||
}
|
|
||||||
if (appTheme.includes('light')) {
|
if (appTheme.includes('light')) {
|
||||||
setNativeTheme('light')
|
setNativeTheme('light')
|
||||||
|
} else if (appTheme === 'system') {
|
||||||
|
setNativeTheme('system')
|
||||||
} else {
|
} else {
|
||||||
setNativeTheme('dark')
|
setNativeTheme('dark')
|
||||||
}
|
}
|
||||||
|
setTheme(appTheme)
|
||||||
}, [appTheme])
|
}, [appTheme])
|
||||||
|
|
||||||
const onDragEnd = async (event: DragEndEvent): Promise<void> => {
|
const onDragEnd = async (event: DragEndEvent): Promise<void> => {
|
||||||
|
|||||||
@ -82,15 +82,14 @@ const Settings: React.FC = () => {
|
|||||||
themeStr += `-${color}`
|
themeStr += `-${color}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setTheme(themeStr)
|
|
||||||
if (themeStr === 'system') {
|
|
||||||
setNativeTheme('system')
|
|
||||||
}
|
|
||||||
if (themeStr.includes('light')) {
|
if (themeStr.includes('light')) {
|
||||||
setNativeTheme('light')
|
setNativeTheme('light')
|
||||||
|
} else if (themeStr === 'system') {
|
||||||
|
setNativeTheme('system')
|
||||||
} else {
|
} else {
|
||||||
setNativeTheme('dark')
|
setNativeTheme('dark')
|
||||||
}
|
}
|
||||||
|
setTheme(themeStr)
|
||||||
patchAppConfig({ appTheme: themeStr as AppTheme })
|
patchAppConfig({ appTheme: themeStr as AppTheme })
|
||||||
} else {
|
} else {
|
||||||
let themeStr = theme
|
let themeStr = theme
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user