Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix checking prefers-color-scheme media query

Gaeulbyulb5b628ae3f7b
diff --git a/hooks/useTheme.js b/hooks/useTheme.js
index 9807f8667..3b13de3d7 100644
--- a/hooks/useTheme.js
+++ b/hooks/useTheme.js
@@ -7,7 +7,7 @@ import { useEffect } from 'react';
export default function useTheme() {
const defaultTheme =
typeof window !== 'undefined'
- ? window?.matchMedia('prefers-color-scheme: dark')?.matches
+ ? window?.matchMedia('(prefers-color-scheme: dark)')?.matches
? 'dark'
: 'light'
: 'light';