mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +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:
2
jslib
2
jslib
Submodule jslib updated: 764dc40b36...a20e935268
@@ -12,6 +12,8 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
||||
@@ -174,12 +176,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
async load() {
|
||||
let loaded = false;
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async params => {
|
||||
if (loaded) {
|
||||
return;
|
||||
}
|
||||
loaded = true;
|
||||
this.route.queryParams.pipe(first()).subscribe(async params => {
|
||||
await this.groupingsComponent.load();
|
||||
|
||||
if (params == null) {
|
||||
@@ -223,9 +220,6 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
await this.ciphersComponent.reload();
|
||||
}
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user