From 6bdb157af320fb42e3a4ccfc96e5786a6ae4e2f5 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Thu, 17 Jul 2025 12:03:21 +0800 Subject: [PATCH] fix: set os attribute correctly to body (#8225) * feat: add os constants * update --- src/renderer/src/context/ThemeProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/context/ThemeProvider.tsx b/src/renderer/src/context/ThemeProvider.tsx index 85b0dbae86..b818472076 100644 --- a/src/renderer/src/context/ThemeProvider.tsx +++ b/src/renderer/src/context/ThemeProvider.tsx @@ -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 = ({ 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