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:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
NgZone,
|
||||
} from '@angular/core';
|
||||
@@ -23,7 +24,7 @@ const BroadcasterSubscriptionId = 'RegisterComponent';
|
||||
selector: 'app-register',
|
||||
templateUrl: 'register.component.html',
|
||||
})
|
||||
export class RegisterComponent extends BaseRegisterComponent implements OnInit {
|
||||
export class RegisterComponent extends BaseRegisterComponent implements OnInit, OnDestroy {
|
||||
constructor(authService: AuthService, router: Router,
|
||||
i18nService: I18nService, cryptoService: CryptoService,
|
||||
apiService: ApiService, stateService: StateService,
|
||||
@@ -46,6 +47,10 @@ export class RegisterComponent extends BaseRegisterComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||
}
|
||||
|
||||
onWindowHidden() {
|
||||
this.showPassword = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user