1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-08-22 22:32:57 +02:00

handle org plans uncovered undefined case (#8008)

This commit is contained in:
Jonathan Prusik 2024-02-20 13:19:46 -05:00 committed by GitHub
parent 0576bd9f2c
commit e3e58fa037
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,12 +288,13 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
get selectablePlans() {
const selectedProductType = this.formGroup.controls.product.value;
const result = this.passwordManagerPlans?.filter(
(plan) =>
plan.product === selectedProductType &&
((!this.isProviderQualifiedFor2020Plan() && this.planIsEnabled(plan)) ||
(this.isProviderQualifiedFor2020Plan() && Allowed2020PlanTypes.includes(plan.type))),
);
const result =
this.passwordManagerPlans?.filter(
(plan) =>
plan.product === selectedProductType &&
((!this.isProviderQualifiedFor2020Plan() && this.planIsEnabled(plan)) ||
(this.isProviderQualifiedFor2020Plan() && Allowed2020PlanTypes.includes(plan.type))),
) || [];
result.sort((planA, planB) => planA.displaySortOrder - planB.displaySortOrder);
return result;