Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/some-birds-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fix issue where "Manage Subscription" button appeared on default free plans.
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Looks like you fixed something additional here? Could you give a bit more context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, that branch was checking planPeriod === 'annual' && Boolean(plan.annualMonthlyFee) (so, the desired plan period is annual and the plan has an annual monthly fee). I added the planPeriod === 'monthly' && Boolean(plan.fee) to account for annual-only plans.

const isActiveFreeTrial = plan.freeTrialEnabled && subscription.isFreeTrial;

if (isCanceled || isSwitchingPaidPeriod) {
Expand Down
Loading