From 2afa36f598aba4e32cc88b57bb8e60339614c792 Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:12:23 -0600 Subject: [PATCH] [PM-21421] Show current plan instead of legacy plan when resubscribing (#17949) * Show current plan instead of legacy plan when resubscribing * Claude / Kyle feedback --- .../change-plan-dialog.component.ts | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts b/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts index 978bb35c5c7..d14f627127a 100644 --- a/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts +++ b/apps/web/src/app/billing/organizations/change-plan-dialog.component.ts @@ -387,6 +387,8 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy { this.focusedIndex = this.selectableProducts.length - 1; if (!this.isSubscriptionCanceled) { await this.selectPlan(this.getPlanByType(ProductTierType.Enterprise)); + } else { + await this.selectPlan(this.reSubscribablePlan); } } @@ -547,10 +549,28 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy { return this.selectedPlan.isAnnual ? "year" : "month"; } + get reSubscribablePlan() { + if (!this.currentPlan) { + throw new Error( + "Current plan must be set to find the re-subscribable plan for a cancelled subscription.", + ); + } + if (!this.currentPlan.disabled) { + return this.currentPlan; + } + return ( + this.passwordManagerPlans.find( + (plan) => + plan.productTier === this.currentPlan.productTier && + plan.isAnnual === this.currentPlan.isAnnual && + !plan.disabled, + ) ?? this.currentPlan + ); + } + get selectableProducts() { if (this.isSubscriptionCanceled) { - // Return only the current plan if the subscription is canceled - return [this.currentPlan]; + return [this.reSubscribablePlan]; } if (this.acceptingSponsorship) {