From 04aefb253d76a1531004162440fe73b8e8bb0253 Mon Sep 17 00:00:00 2001 From: Harsh Kumar <9u.harsh@gmail.com> Date: Thu, 8 Oct 2026 14:27:03 +0530 Subject: [PATCH] fix(dashboard): show choosing state only on clicked plan (#2651) * fix: show choosing state only on clicked plan * fix(dashboard): derive pending plan from the running mutation --------- Co-authored-by: Maximilian Kaske --- .../src/components/data-table/billing/data-table.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/components/data-table/billing/data-table.tsx b/apps/dashboard/src/components/data-table/billing/data-table.tsx index a8d82e2da..326b19966 100644 --- a/apps/dashboard/src/components/data-table/billing/data-table.tsx +++ b/apps/dashboard/src/components/data-table/billing/data-table.tsx @@ -97,6 +97,13 @@ export function DataTable({ restrictTo }: { restrictTo?: WorkspacePlan[] }) { }), ); + // Which button is in flight, derived from the running mutation. + const pendingPlan: WorkspacePlan | null = checkoutSessionMutation.isPending + ? checkoutSessionMutation.variables.plan + : customerPortalMutation.isPending + ? "free" + : null; + if (!workspace) return null; const isTrialing = workspace.trialDaysLeft !== null; @@ -221,7 +228,7 @@ export function DataTable({ restrictTo }: { restrictTo?: WorkspacePlan[] }) { ? isTrialing ? "On Trial" : "Current Plan" - : isPending + : pendingPlan === id ? "Choosing..." : isIntervalSwitch ? `Switch to ${interval}` -- 2.51.2