1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

[PM-17955][Defect] Blank loading modal briefly shown before the Upgrade modal (#13294)

* Resolve the secrets manager loading issue

* Resolve the secrets manager loading issue

* Resolve a pr comment

* Resolve the refreshSalesTax error
This commit is contained in:
cyprain-okeke
2025-02-07 15:43:37 +01:00
committed by GitHub
parent 179ddc271f
commit ab243fc88e

View File

@@ -184,6 +184,7 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
paymentSource?: PaymentSourceResponse; paymentSource?: PaymentSourceResponse;
plans: ListResponse<PlanResponse>; plans: ListResponse<PlanResponse>;
isSubscriptionCanceled: boolean = false; isSubscriptionCanceled: boolean = false;
secretsManagerTotal: number;
private destroy$ = new Subject<void>(); private destroy$ = new Subject<void>();
@@ -289,7 +290,9 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
const taxInfo = await this.organizationApiService.getTaxInfo(this.organizationId); const taxInfo = await this.organizationApiService.getTaxInfo(this.organizationId);
this.taxInformation = TaxInformation.from(taxInfo); this.taxInformation = TaxInformation.from(taxInfo);
this.refreshSalesTax(); if (!this.isSubscriptionCanceled) {
this.refreshSalesTax();
}
} }
resolveHeaderName(subscription: OrganizationSubscriptionResponse): string { resolveHeaderName(subscription: OrganizationSubscriptionResponse): string {
@@ -468,7 +471,11 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
} }
get selectedSecretsManagerPlan() { get selectedSecretsManagerPlan() {
return this.secretsManagerPlans.find((plan) => plan.type === this.selectedPlan.type); let planResponse: PlanResponse;
if (this.secretsManagerPlans) {
return this.secretsManagerPlans.find((plan) => plan.type === this.selectedPlan.type);
}
return planResponse;
} }
get selectedPlanInterval() { get selectedPlanInterval() {
@@ -610,17 +617,18 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
} }
get secretsManagerSubtotal() { get secretsManagerSubtotal() {
this.secretsManagerTotal = 0;
const plan = this.selectedSecretsManagerPlan; const plan = this.selectedSecretsManagerPlan;
if (!this.organization.useSecretsManager) { if (!this.organization.useSecretsManager) {
return 0; return this.secretsManagerTotal;
} }
return ( this.secretsManagerTotal =
plan.SecretsManager.basePrice + plan.SecretsManager.basePrice +
this.secretsManagerSeatTotal(plan, this.sub?.smSeats) + this.secretsManagerSeatTotal(plan, this.sub?.smSeats) +
this.additionalServiceAccountTotal(plan) this.additionalServiceAccountTotal(plan);
); return this.secretsManagerTotal;
} }
get passwordManagerSeats() { get passwordManagerSeats() {
@@ -631,11 +639,11 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
} }
get total() { get total() {
if (this.organization.useSecretsManager) { if (this.organization && this.organization.useSecretsManager) {
return ( return (
this.passwordManagerSubtotal + this.passwordManagerSubtotal +
this.additionalStorageTotal(this.selectedPlan) + this.additionalStorageTotal(this.selectedPlan) +
this.secretsManagerSubtotal + this.secretsManagerTotal +
this.estimatedTax this.estimatedTax
); );
} }