diff --git a/src/initial-resources/index.ts b/src/initial-resources/index.ts index 44a21d2..8280c61 100644 --- a/src/initial-resources/index.ts +++ b/src/initial-resources/index.ts @@ -17,7 +17,7 @@ function addThemeListener() { // Apply the theme setTheme(); // Listen for a theme change - mediaQuery.addEventListener("change", setTheme); + mediaQuery.addEventListener?.("change", setTheme); } function registerServiceWorker() {