Skip to content
Snippets Groups Projects
Unverified Commit 4a832e87 authored by woxtu's avatar woxtu Committed by GitHub
Browse files

Replace deprecated `MediaQueryList.addListener()` (#12112)

parent 9dcccbc8
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment