1
0
mirror of https://github.com/bitwarden/web synced 2025-12-10 21:33:16 +00:00

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

* Use rxjs first instead of unsubscribe

* Use rxjs first instead of unsubscribe

* Update jslib

* Update jslib

* Downgrade jslib to before breaking changes
This commit is contained in:
Thomas Rittson
2021-10-15 08:59:43 +10:00
committed by GitHub
parent 356262975c
commit 98bd41d4b1
17 changed files with 50 additions and 81 deletions

View File

@@ -7,6 +7,8 @@ import {
Router,
} from '@angular/router';
import { first } from 'rxjs/operators';
import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
@@ -31,12 +33,7 @@ export class VerifyRecoverDeleteComponent implements OnInit {
}
ngOnInit() {
let fired = false;
this.route.queryParams.subscribe(async qParams => {
if (fired) {
return;
}
fired = true;
this.route.queryParams.pipe(first()).subscribe(async qParams => {
if (qParams.userId != null && qParams.token != null && qParams.email != null) {
this.userId = qParams.userId;
this.token = qParams.token;