diff --git a/src/services/browserPlatformUtils.service.ts b/src/services/browserPlatformUtils.service.ts index 28d28f30cb..d9bd172c85 100644 --- a/src/services/browserPlatformUtils.service.ts +++ b/src/services/browserPlatformUtils.service.ts @@ -344,7 +344,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService } onDefaultSystemThemeChange(callback: ((theme: 'light' | 'dark') => unknown)) { - this.prefersColorSchemeDark.addListener(({ matches }) => { + this.prefersColorSchemeDark.addEventListener('change', ({ matches }) => { callback(matches ? 'dark' : 'light'); }); }