Some dimensions were not set on page load

This commit is contained in:
Misode
2022-05-09 02:38:39 +02:00
parent e63b4839dc
commit 2593172855
4 changed files with 8 additions and 8 deletions

View File

@@ -39,6 +39,10 @@ export function ThemeProvider({ children }: { children: ComponentChildren }) {
Analytics.setPrefersColorScheme(prefersLight ? 'light' : prefersDark ? 'dark' : 'none')
}, [prefersLight, prefersDark])
useEffect(() => {
Analytics.setTheme(theme)
}, [])
const value: Theme = {
theme,
actualTheme: theme === 'light' || (theme !== 'dark' && prefersLight) ? 'light' : 'dark',