PWA注册改为异步避免影响加载速度

This commit is contained in:
eoao
2025-09-05 17:26:08 +08:00
parent 25a27ec038
commit 2c6803475b
3 changed files with 6 additions and 13 deletions

View File

@@ -231,7 +231,7 @@ function switchDark(nextIsDark, root) {
root.setAttribute('class', nextIsDark ? 'dark' : '')
const metaTag = document.getElementById('theme-color-meta');
const isMobile = !window.matchMedia("(pointer: fine) and (hover: hover)").matches;
metaTag.setAttribute('content', nextIsDark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#D3E3FD'));
metaTag.setAttribute('content', nextIsDark ? (isMobile ? '#141414' : '#000000') : (isMobile ? '#FFFFFF' : '#F1F1F1'));
uiStore.dark = nextIsDark
}