diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 8a0e45aa..284167c9 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -28,8 +28,12 @@ export default function (props: any) { useEffect(() => { const colorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches && 'dark'; - const theme = - localStorage.getItem('qinglong_dark_theme') || colorScheme || 'light'; + console.log(colorScheme); + let localTheme = localStorage.getItem('qinglong_dark_theme'); + if (localTheme === 'auto') { + localTheme = null; + } + const theme = localTheme || colorScheme || 'light'; setFetchMethod(window.fetch); if (theme === 'dark') { enableDarkMode({ darkSchemeTextColor: '#fff' }); @@ -45,7 +49,7 @@ export default function (props: any) { { + menuItemRender={(menuItemProps: any, defaultDom: any) => { if ( menuItemProps.isUrl || !menuItemProps.path ||