chore: init mask theme

This commit is contained in:
jialin
2025-05-15 19:04:40 +08:00
parent ac03a93c64
commit 17ec70f839
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -37,6 +37,15 @@ const DarkModeMask = () => {
const maskRef = useRef<HTMLDivElement>(null); const maskRef = useRef<HTMLDivElement>(null);
const timerRef = useRef<any>(null); const timerRef = useRef<any>(null);
const initTheme = () => {
const html = document.querySelector('html');
if (html) {
html.setAttribute('data-theme', savedTheme);
}
};
initTheme();
useEffect(() => { useEffect(() => {
if (savedTheme === 'realDark') { if (savedTheme === 'realDark') {
setVisible(true); setVisible(true);
+1 -1
View File
@@ -431,7 +431,7 @@ export default (props: any) => {
...themeData ...themeData
}} }}
> >
<DarkMask theme={userSettings.theme}></DarkMask> <DarkMask></DarkMask>
<ProLayout <ProLayout
route={route} route={route}
location={location} location={location}