mirror of
https://github.com/bitwarden/web
synced 2025-12-18 09:13:17 +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:
@@ -5,6 +5,8 @@ import {
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { PlanType } from 'jslib-common/enums/planType';
|
||||
import { ProductType } from 'jslib-common/enums/productType';
|
||||
|
||||
@@ -20,7 +22,7 @@ export class CreateOrganizationComponent implements OnInit {
|
||||
constructor(private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit() {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
if (qParams.plan === 'families') {
|
||||
this.orgPlansComponent.plan = PlanType.FamiliesAnnually;
|
||||
this.orgPlansComponent.product = ProductType.Families;
|
||||
@@ -31,9 +33,6 @@ export class CreateOrganizationComponent implements OnInit {
|
||||
this.orgPlansComponent.plan = PlanType.EnterpriseAnnually;
|
||||
this.orgPlansComponent.product = ProductType.Enterprise;
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user