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:
2
jslib
2
jslib
Submodule jslib updated: 764dc40b36...a20e935268
@@ -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();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user