Skip to content

Commit

Permalink
Add optional chain for mediaQuery listener
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanpingle committed Sep 30, 2024
1 parent d1b7fe5 commit d3172e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/initial-resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d3172e3

Please sign in to comment.