mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
[PM-2197] Fix memory leaks in Safari (#5451)
* Remove reference cycle between ThemingService and the global window object * Deregister messageListeners on a safari popup to avoid mem leaks * Use pagehide event instead of unload
This commit is contained in:
@@ -63,7 +63,7 @@ export class ThemingService implements AbstractThemingService {
|
||||
|
||||
protected monitorSystemThemeChanges(): void {
|
||||
fromEvent<MediaQueryListEvent>(
|
||||
this.window.matchMedia("(prefers-color-scheme: dark)"),
|
||||
window.matchMedia("(prefers-color-scheme: dark)"),
|
||||
"change"
|
||||
).subscribe((event) => {
|
||||
this.updateSystemTheme(event.matches ? ThemeType.Dark : ThemeType.Light);
|
||||
|
||||
Reference in New Issue
Block a user