diff --git a/.changeset/some-birds-know.md b/.changeset/some-birds-know.md new file mode 100644 index 00000000000..a523ff78109 --- /dev/null +++ b/.changeset/some-birds-know.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Fix issue where "Manage Subscription" button appeared on default free plans. diff --git a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts index 634d24a9189..ca4711e2506 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts +++ b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts @@ -38,7 +38,10 @@ const valueResolution = (params: UsePricingFooterStateParams): [boolean, boolean // Active subscription if (subscription.status === 'active') { const isCanceled = !!subscription.canceledAt; - const isSwitchingPaidPeriod = planPeriod !== subscription.planPeriod && Boolean(plan.annualMonthlyFee); + const isSwitchingPaidPeriod = + !subscription.plan.isDefault && + planPeriod !== subscription.planPeriod && + ((planPeriod === 'annual' && Boolean(plan.annualMonthlyFee)) || (planPeriod === 'month' && Boolean(plan.fee))); const isActiveFreeTrial = plan.freeTrialEnabled && subscription.isFreeTrial; if (isCanceled || isSwitchingPaidPeriod) {