Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/web/modules/ee/billing/lib/organization-billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,11 @@ export const switchOrganizationToCloudPlan = async (input: {
const currentPlan = resolveCloudPlanFromSubscription(subscription);
const currentInterval = resolveSubscriptionInterval(subscription);

const isImmediateUpgrade = CLOUD_PLAN_LEVEL[input.targetPlan] > CLOUD_PLAN_LEVEL[currentPlan];
// Non-standard plans (custom, unknown) don't follow the normal tier hierarchy,
// so any switch from them to a standard plan should apply immediately.
const isNonStandardCurrentPlan = currentPlan === "custom" || currentPlan === "unknown";
const isImmediateUpgrade =
isNonStandardCurrentPlan || CLOUD_PLAN_LEVEL[input.targetPlan] > CLOUD_PLAN_LEVEL[currentPlan];
const isSameSelection = currentPlan === input.targetPlan && currentInterval === input.targetInterval;

if (isSameSelection) {
Expand Down
Loading