From 768b5393e970937c8270c0bc3dd2499a384a4464 Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:13:03 -0400 Subject: [PATCH] Null check provider in organization management check (#10233) --- .../organization-subscription-cloud.component.html | 4 ++-- .../organization-subscription-cloud.component.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html index 72a0a40080..dff6cc5c61 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html +++ b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html @@ -1,6 +1,6 @@ - + {{ "loading" | i18n }} @@ -274,7 +274,7 @@ - +
diff --git a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts index 61a0c9c80b..20c38ec94f 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts +++ b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts @@ -50,7 +50,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy locale: string; showUpdatedSubscriptionStatusSection$: Observable; manageBillingFromProviderPortal = ManageBilling; - isProviderManaged = false; + isManagedByConsolidatedBillingMSP = false; enableTimeThreshold: boolean; preSelectedProductTier: ProductTierType = ProductTierType.Free; @@ -126,10 +126,10 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy if (this.userOrg.canViewSubscription) { const enableConsolidatedBilling = await firstValueFrom(this.enableConsolidatedBilling$); const provider = await this.providerService.get(this.userOrg.providerId); - this.isProviderManaged = + this.isManagedByConsolidatedBillingMSP = enableConsolidatedBilling && this.userOrg.hasProvider && - provider.providerStatus == ProviderStatusType.Billable; + provider?.providerStatus == ProviderStatusType.Billable; this.sub = await this.organizationApiService.getSubscription(this.organizationId); this.lineItems = this.sub?.subscription?.items;