mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-28 12:45:45 +01: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:
parent
7327ab75c9
commit
77ab177d2c
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit 764dc40b36e0000807e59b8d6feea5ac4577270d
|
||||
Subproject commit a20e935268c986538ff68f72016bb8c772ea3a1b
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user