1
0
Fork 0
mirror of https://github.com/paricafe/misskey.git synced 2025-03-24 13:19:29 -05:00

Replace deprecated MediaQueryList.addListener() ()

This commit is contained in:
woxtu 2023-10-23 15:32:10 +09:00 committed by GitHub
parent 9dcccbc8e1
commit 4a832e87c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}