fix auto theme
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run

This commit is contained in:
pompurin404 2024-08-19 21:07:16 +08:00
parent 2b0433ec41
commit 7e0f58d79d
No known key found for this signature in database
2 changed files with 6 additions and 8 deletions

View File

@ -63,15 +63,14 @@ const App: React.FC = () => {
}, [siderOrder])
useEffect(() => {
setTheme(appTheme)
if (appTheme === 'system') {
setNativeTheme('system')
}
if (appTheme.includes('light')) {
setNativeTheme('light')
} else if (appTheme === 'system') {
setNativeTheme('system')
} else {
setNativeTheme('dark')
}
setTheme(appTheme)
}, [appTheme])
const onDragEnd = async (event: DragEndEvent): Promise<void> => {

View File

@ -82,15 +82,14 @@ const Settings: React.FC = () => {
themeStr += `-${color}`
}
}
setTheme(themeStr)
if (themeStr === 'system') {
setNativeTheme('system')
}
if (themeStr.includes('light')) {
setNativeTheme('light')
} else if (themeStr === 'system') {
setNativeTheme('system')
} else {
setNativeTheme('dark')
}
setTheme(themeStr)
patchAppConfig({ appTheme: themeStr as AppTheme })
} else {
let themeStr = theme