Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix getNextPlan

Steven Tey2c58d60b7dfb
diff --git a/packages/utils/src/constants/pricing.tsx b/packages/utils/src/constants/pricing.tsx
index 56f583d638..9ca006ccec 100644
--- a/packages/utils/src/constants/pricing.tsx
+++ b/packages/utils/src/constants/pricing.tsx
@@ -351,8 +351,9 @@ export const getCurrentPlan = (plan: string) => {
export const getNextPlan = (plan?: string | null) => {
if (!plan) return PRO_PLAN;
+ const currentPlan = plan.toLowerCase().split(" ")[0]; // to account for old Business plans (e.g. "Business Plus")
return PLANS[
- PLANS.findIndex((p) => p.name.toLowerCase() === plan.toLowerCase()) + 1
+ PLANS.findIndex((p) => p.name.toLowerCase() === currentPlan) + 1
];
};