1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

onDestroy needed for broadcast subscriptions

This commit is contained in:
Chad Scharf
2020-11-04 14:00:44 -05:00
parent c9c6a11390
commit 97e982bf01
7 changed files with 40 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import {
Component,
OnDestroy,
NgZone,
} from '@angular/core';
import {
@@ -28,7 +29,7 @@ const BroadcasterSubscriptionId = 'LockComponent';
selector: 'app-lock',
templateUrl: 'lock.component.html',
})
export class LockComponent extends BaseLockComponent {
export class LockComponent extends BaseLockComponent implements OnDestroy {
constructor(router: Router, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, messagingService: MessagingService,
userService: UserService, cryptoService: CryptoService,
@@ -59,6 +60,10 @@ export class LockComponent extends BaseLockComponent {
});
}
ngOnDestroy() {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
onWindowHidden() {
this.showPassword = false;
}