From 4a832e87c0500a18229128d0cd676d505054e862 Mon Sep 17 00:00:00 2001 From: woxtu Date: Mon, 23 Oct 2023 15:32:10 +0900 Subject: [PATCH] Replace deprecated `MediaQueryList.addListener()` (#12112) --- packages/frontend/src/boot/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 8346962e0..12bb56a87 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -175,7 +175,7 @@ export async function common(createVue: () => App) { 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); }