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}`