@@ -5,8 +5,7 @@ import { concatMap, firstValueFrom, lastValueFrom, Observable, Subject, takeUnti
5
5
import { ApiService } from "@bitwarden/common/abstractions/api.service" ;
6
6
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction" ;
7
7
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction" ;
8
- import { ProviderApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/provider/provider-api.service.abstraction" ;
9
- import { OrganizationApiKeyType , ProviderType } from "@bitwarden/common/admin-console/enums" ;
8
+ import { OrganizationApiKeyType } from "@bitwarden/common/admin-console/enums" ;
10
9
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization" ;
11
10
import { PlanType } from "@bitwarden/common/billing/enums" ;
12
11
import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/models/response/organization-subscription.response" ;
@@ -70,7 +69,6 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
70
69
private route : ActivatedRoute ,
71
70
private dialogService : DialogService ,
72
71
private configService : ConfigService ,
73
- private providerService : ProviderApiServiceAbstraction ,
74
72
) { }
75
73
76
74
async ngOnInit ( ) {
@@ -108,15 +106,15 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
108
106
this . loading = true ;
109
107
this . locale = await firstValueFrom ( this . i18nService . locale$ ) ;
110
108
this . userOrg = await this . organizationService . get ( this . organizationId ) ;
111
- if ( this . userOrg . hasProvider ) {
112
- const provider = await this . providerService . getProvider ( this . userOrg . providerId ) ;
113
- const enableConsolidatedBilling = await firstValueFrom ( this . enableConsolidatedBilling$ ) ;
114
- this . isProviderManaged = provider . type == ProviderType . Msp && enableConsolidatedBilling ;
115
- }
116
109
117
110
if ( this . userOrg . canViewSubscription ) {
111
+ const enableConsolidatedBilling = await firstValueFrom ( this . enableConsolidatedBilling$ ) ;
112
+
113
+ this . isProviderManaged = enableConsolidatedBilling && this . userOrg . hasProvider ;
114
+
118
115
this . sub = await this . organizationApiService . getSubscription ( this . organizationId ) ;
119
116
this . lineItems = this . sub ?. subscription ?. items ;
117
+
120
118
if ( this . lineItems && this . lineItems . length ) {
121
119
this . lineItems = this . lineItems
122
120
. map ( ( item ) => {
0 commit comments