1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

unsub from queryParams observable

This commit is contained in:
Kyle Spearrin
2018-12-20 10:20:57 -05:00
parent 2a87fc14c2
commit fd5d47da7c
10 changed files with 19 additions and 10 deletions

View File

@@ -72,7 +72,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
}
async ngOnInit() {
this.route.queryParams.subscribe(async (params) => {
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
if (params.type) {
this.searchPlaceholder = this.i18nService.t('searchType');
this.type = parseInt(params.type, null);
@@ -131,6 +131,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
window.setTimeout(() => this.popupUtils.setContentScrollY(window, this.state.scrollY), 0);
}
this.stateService.remove(ComponentId);
queryParamsSub.unsubscribe();
});
this.broadcasterService.subscribe(ComponentId, (message: any) => {