mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat: optimize electron macos header style (#1774)
Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
@@ -47,6 +47,7 @@ const ThemeProviderInner = memo<React.PropsWithChildren>(
|
||||
// SSR will always render the light theme, so we need to defer the theme if user selected dark mode
|
||||
const [deferTheme, setDeferTheme] = useState('light');
|
||||
useEffect(() => {
|
||||
window.apis?.onThemeChange(theme === 'dark' ? 'dark' : 'light');
|
||||
setDeferTheme(theme === 'dark' ? 'dark' : 'light');
|
||||
}, [theme]);
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user