mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 05:51:26 +08:00
fix: set os attribute correctly to body (#8225)
* feat: add os constants * update
This commit is contained in:
parent
04afa61d55
commit
6bdb157af3
@ -1,4 +1,4 @@
|
||||
import { isMac } from '@renderer/config/constant'
|
||||
import { isMac, isWin } from '@renderer/config/constant'
|
||||
import { useSettings } from '@renderer/hooks/useSettings'
|
||||
import useUserTheme from '@renderer/hooks/useUserTheme'
|
||||
import { ThemeMode } from '@renderer/types'
|
||||
@ -40,7 +40,7 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
|
||||
|
||||
useEffect(() => {
|
||||
// Set initial theme and OS attributes on body
|
||||
document.body.setAttribute('os', isMac ? 'mac' : 'windows')
|
||||
document.body.setAttribute('os', isMac ? 'mac' : isWin ? 'windows' : 'linux')
|
||||
document.body.setAttribute('theme-mode', actualTheme)
|
||||
|
||||
// if theme is old auto, then set theme to system
|
||||
|
||||
Loading…
Reference in New Issue
Block a user