mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 01:11:07 +03:00
chore(web): passive events (#19179)
This commit is contained in:
@@ -52,11 +52,15 @@ class ThemeManager {
|
||||
}
|
||||
|
||||
#onAppInit() {
|
||||
globalThis.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
||||
if (this.theme.system) {
|
||||
this.#update('system');
|
||||
}
|
||||
});
|
||||
globalThis.matchMedia('(prefers-color-scheme: dark)').addEventListener(
|
||||
'change',
|
||||
() => {
|
||||
if (this.theme.system) {
|
||||
this.#update('system');
|
||||
}
|
||||
},
|
||||
{ passive: true },
|
||||
);
|
||||
}
|
||||
|
||||
#update(value: Theme | 'system') {
|
||||
|
||||
Reference in New Issue
Block a user