Skip to content

Commit 022b221

Browse files
committed
Fixes wrong next paid plan
1 parent 0da4dff commit 022b221

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plus/gk/utils/subscription.utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ export function computeSubscriptionState(subscription: Optional<Subscription, 's
8383
}
8484

8585
export function getSubscriptionNextPaidPlanId(subscription: Optional<Subscription, 'state'>): PaidSubscriptionPlanIds {
86-
const next = orderedPaidPlans.indexOf(subscription.plan.actual.id as PaidSubscriptionPlanIds) + 1;
86+
let next = orderedPaidPlans.indexOf(subscription.plan.actual.id as PaidSubscriptionPlanIds) + 1;
87+
// Skip the student plan since we cannot determine if the user is student-eligible or not
88+
if (next === 0) {
89+
next++;
90+
}
91+
8792
if (next >= orderedPaidPlans.length) return 'enterprise'; // Not sure what to do here
8893

8994
return orderedPaidPlans[next] ?? 'pro';

0 commit comments

Comments
 (0)