1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-23 03:22:50 +02:00

Null check provider in organization management check (#10233)

This commit is contained in:
Alex Morask 2024-07-24 10:13:03 -04:00 committed by GitHub
parent 9a6b37d019
commit 768b5393e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<app-header></app-header>
<bit-container *ngIf="!isProviderManaged">
<bit-container *ngIf="!isManagedByConsolidatedBillingMSP">
<ng-container *ngIf="!firstLoaded && loading">
<i class="bwi bwi-spinner bwi-spin text-muted" title="{{ 'loading' | i18n }}"></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
@ -274,7 +274,7 @@
</ng-container>
</ng-container>
</bit-container>
<bit-container *ngIf="isProviderManaged">
<bit-container *ngIf="isManagedByConsolidatedBillingMSP">
<div
class="tw-mx-auto tw-flex tw-flex-col tw-items-center tw-justify-center tw-pt-24 tw-text-center tw-font-bold"
>

View File

@ -50,7 +50,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
locale: string;
showUpdatedSubscriptionStatusSection$: Observable<boolean>;
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;