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.

small improvements

Steven Tey19076c0d39db
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
index 477a06f7a0..1d9a3680f0 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
@@ -86,11 +86,15 @@ export const POST = withWorkspace(
} else {
const customer = await getDubCustomer(session.user.id);
- // New Stripe customer + no prior trial on workspace: partner checkout trial.
- // Returning Stripe customers (e.g. canceled sub) must not get another trial here.
+ // Only apply trial if the customer is a:
+ // - new Stripe customer
+ // - no prior/existing trial on workspace
+ // - is coming from onboarding
+ // - is trial variant
const shouldApplyCheckoutTrial =
workspace.stripeId == null &&
workspace.trialEndsAt == null &&
+ onboarding &&
isTrialVariant;
const stripeSession = await stripe.checkout.sessions.create({
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-upgrade-cta.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-upgrade-cta.tsx
index 23f183a2c7..b3913451b1 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-upgrade-cta.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-upgrade-cta.tsx
@@ -22,7 +22,7 @@ export function PartnersUpgradeCTA({
if (!canManageProgram || isLegacyBusinessPlan({ plan, payoutsLimit })) {
return {
cta: "Upgrade plan",
- href: `/${slug}/upgrade`,
+ href: `/${slug}/upgrade?plan=business`,
};
} else {
return {
diff --git a/apps/web/ui/layout/sidebar/sidebar-usage.tsx b/apps/web/ui/layout/sidebar/sidebar-usage.tsx
index 32c10aa77d..2244679200 100644
--- a/apps/web/ui/layout/sidebar/sidebar-usage.tsx
+++ b/apps/web/ui/layout/sidebar/sidebar-usage.tsx
@@ -270,7 +270,7 @@ function UsageInner() {
setHovered(false);
}}
>
- {plan === "free" ? "Get Dub Pro" : "Upgrade plan"}
+ Upgrade plan
</Link>
) : null}
</div>