Skip to content

Commit

Permalink
Replace deprecated MediaQueryList.addListener() (#12112)
Browse files Browse the repository at this point in the history
  • Loading branch information
woxtu authored Oct 23, 2023
1 parent 9dcccbc commit 4a832e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/boot/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export async function common(createVue: () => App<Element>) {
defaultStore.set('darkMode', isDeviceDarkmode());
}

window.matchMedia('(prefers-color-scheme: dark)').addListener(mql => {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (mql) => {
if (ColdDeviceStorage.get('syncDeviceDarkMode')) {
defaultStore.set('darkMode', mql.matches);
}
Expand Down

0 comments on commit 4a832e8

Please sign in to comment.