mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-07 19:07:45 +01:00
unsub from queryParams observable
This commit is contained in:
parent
2a87fc14c2
commit
fd5d47da7c
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit aa1784932945bfd1115f366cf5dafc6b481c19a3
|
||||
Subproject commit cddeeefdbb14d5f70020fb705885eb05a0bb4339
|
@ -24,11 +24,12 @@ export class FolderAddEditComponent extends BaseFolderAddEditComponent {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
if (params.folderId) {
|
||||
this.folderId = params.folderId;
|
||||
}
|
||||
await super.ngOnInit();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
async ngOnInit() {
|
||||
await super.ngOnInit();
|
||||
this.showAttachments = !this.platformUtilsService.isEdge();
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
if (params.cipherId) {
|
||||
this.cipherId = params.cipherId;
|
||||
}
|
||||
@ -65,6 +65,7 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
this.cipher.login.uris[0].uri = params.uri;
|
||||
}
|
||||
}
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
|
||||
window.setTimeout(() => {
|
||||
|
@ -23,9 +23,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
this.cipherId = params.cipherId;
|
||||
await super.ngOnInit();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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) => {
|
||||
|
@ -24,9 +24,10 @@ export class CollectionsComponent extends BaseCollectionsComponent {
|
||||
this.onSavedCollections.subscribe(() => {
|
||||
this.back();
|
||||
});
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
this.cipherId = params.cipherId;
|
||||
await super.ngOnInit();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
});
|
||||
|
||||
const restoredScopeState = await this.restoreState();
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
this.state = (await this.stateService.get<any>(ComponentId)) || {};
|
||||
if (this.state.searchText) {
|
||||
this.searchText = this.state.searchText;
|
||||
@ -132,6 +132,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
if (!this.syncService.syncInProgress || restoredScopeState) {
|
||||
window.setTimeout(() => this.popupUtils.setContentScrollY(window, this.state.scrollY), 0);
|
||||
}
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ export class PasswordHistoryComponent extends BasePasswordHistoryComponent {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
if (params.cipherId) {
|
||||
this.cipherId = params.cipherId;
|
||||
} else {
|
||||
@ -30,6 +30,7 @@ export class PasswordHistoryComponent extends BasePasswordHistoryComponent {
|
||||
}
|
||||
|
||||
await super.ngOnInit();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -29,9 +29,10 @@ export class ShareComponent extends BaseShareComponent {
|
||||
this.onSharedCipher.subscribe(() => {
|
||||
this.router.navigate(['view-cipher', { cipherId: this.cipherId }]);
|
||||
});
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
this.cipherId = params.cipherId;
|
||||
await super.ngOnInit();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export class ViewComponent extends BaseViewComponent {
|
||||
|
||||
ngOnInit() {
|
||||
this.showAttachments = !this.platformUtilsService.isEdge();
|
||||
this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
if (params.cipherId) {
|
||||
this.cipherId = params.cipherId;
|
||||
} else {
|
||||
@ -50,6 +50,7 @@ export class ViewComponent extends BaseViewComponent {
|
||||
}
|
||||
|
||||
await this.load();
|
||||
queryParamsSub.unsubscribe();
|
||||
});
|
||||
super.ngOnInit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user