1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[Refactor] Use rxjs first instead of unsubscribe from queryParams (#1105)

* Use rxjs first instead of unsubscribe

* Remove unneeded variable

* Update jslib
This commit is contained in:
Thomas Rittson
2021-10-15 07:59:08 +10:00
committed by GitHub
parent 7327ab75c9
commit 77ab177d2c
2 changed files with 4 additions and 10 deletions

2
jslib

Submodule jslib updated: 764dc40b36...a20e935268

View File

@@ -12,6 +12,8 @@ import {
Router, Router,
} from '@angular/router'; } from '@angular/router';
import { first } from 'rxjs/operators';
import { ToasterService } from 'angular2-toaster'; import { ToasterService } from 'angular2-toaster';
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service'; import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
@@ -174,12 +176,7 @@ export class VaultComponent implements OnInit, OnDestroy {
} }
async load() { async load() {
let loaded = false; this.route.queryParams.pipe(first()).subscribe(async params => {
const queryParamsSub = this.route.queryParams.subscribe(async params => {
if (loaded) {
return;
}
loaded = true;
await this.groupingsComponent.load(); await this.groupingsComponent.load();
if (params == null) { if (params == null) {
@@ -223,9 +220,6 @@ export class VaultComponent implements OnInit, OnDestroy {
await this.ciphersComponent.reload(); await this.ciphersComponent.reload();
} }
} }
if (queryParamsSub != null) {
queryParamsSub.unsubscribe();
}
}); });
} }