Skip to content

Commit ce9e26a

Browse files
authored
Update env PR (dubinc#3780)
1 parent c95323b commit ce9e26a

File tree

16 files changed

+13
-98
lines changed

16 files changed

+13
-98
lines changed

apps/web/app/(ee)/api/stripe/webhook/checkout-session-completed.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,6 @@ export async function checkoutSessionCompleted(
133133
variant: "marketing",
134134
})),
135135
),
136-
// enable dub.link premium default domain for the workspace
137-
prisma.defaultDomains.update({
138-
where: {
139-
projectId: workspaceId,
140-
},
141-
data: {
142-
dublink: true,
143-
},
144-
}),
145136
// expire tokens cache
146137
tokenCache.expireMany({
147138
hashedKeys: updatedWorkspace.restrictedTokens.map(

apps/web/app/(ee)/api/stripe/webhook/customer-subscription-deleted.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,6 @@ export async function customerSubscriptionDeleted(
118118
paymentFailedAt: null,
119119
},
120120
}),
121-
122-
// disable dub.link premium default domain for the workspace
123-
prisma.defaultDomains.update({
124-
where: {
125-
projectId: workspace.id,
126-
},
127-
data: {
128-
dublink: false,
129-
},
130-
}),
131-
132121
// remove logo from all domains for the workspace
133122
prisma.domain.updateMany({
134123
where: {

apps/web/app/api/domains/default/route.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { DubApiError } from "@/lib/api/errors";
21
import { withWorkspace } from "@/lib/auth";
32
import { getDefaultDomainsQuerySchema } from "@/lib/zod/schemas/domains";
43
import { prisma } from "@dub/prisma";
@@ -17,7 +16,6 @@ export const GET = withWorkspace(
1716
},
1817
select: {
1918
dubsh: true,
20-
dublink: true,
2119
chatgpt: true,
2220
sptifi: true,
2321
gitnew: true,
@@ -60,21 +58,12 @@ export const PATCH = withWorkspace(
6058
await req.json(),
6159
);
6260

63-
if (workspace.plan === "free" && defaultDomains.includes("dub.link")) {
64-
throw new DubApiError({
65-
code: "forbidden",
66-
message:
67-
"You can only use dub.link on a Pro plan and above. Upgrade to Pro to use this domain.",
68-
});
69-
}
70-
7161
const response = await prisma.defaultDomains.update({
7262
where: {
7363
projectId: workspace.id,
7464
},
7565
data: {
7666
dubsh: defaultDomains.includes("dub.sh"),
77-
dublink: defaultDomains.includes("dub.link"),
7867
chatgpt: defaultDomains.includes("chatg.pt"),
7968
sptifi: defaultDomains.includes("spti.fi"),
8069
gitnew: defaultDomains.includes("git.new"),

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/default/page-client.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useDefaultDomains from "@/lib/swr/use-default-domains";
55
import useWorkspace from "@/lib/swr/use-workspace";
66
import { DomainCardTitleColumn } from "@/ui/domains/domain-card-title-column";
77
import { UpgradeRequiredToast } from "@/ui/shared/upgrade-required-toast";
8-
import { Logo, Switch, TooltipContent } from "@dub/ui";
8+
import { Logo, Switch } from "@dub/ui";
99
import {
1010
Amazon,
1111
CalendarDays,
@@ -75,9 +75,7 @@ export function DefaultDomains() {
7575
</div>
7676

7777
<div className="mt-2 grid grid-cols-1 gap-3">
78-
{DUB_DOMAINS.filter(
79-
(domain) => domain.slug !== "dub.link" || !flags?.noDubLink,
80-
).map(({ slug, description }) => {
78+
{DUB_DOMAINS.map(({ slug, description }) => {
8179
return (
8280
<div
8381
key={slug}
@@ -91,16 +89,7 @@ export function DefaultDomains() {
9189
/>
9290
<Switch
9391
disabled={submitting}
94-
disabledTooltip={
95-
permissionsError ||
96-
(slug === "dub.link" && plan === "free" ? (
97-
<TooltipContent
98-
title="You can only use dub.link on a Pro plan and above. Upgrade to Pro to use this domain."
99-
cta="Upgrade to Pro"
100-
href={`/${slug}/upgrade`}
101-
/>
102-
) : undefined)
103-
}
92+
disabledTooltip={permissionsError ?? undefined}
10493
checked={defaultDomains?.includes(slug)}
10594
fn={() => {
10695
const oldDefaultDomains = defaultDomains.slice();

apps/web/lib/edge-config/get-feature-flags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const getFeatureFlags = async ({
1616
}
1717

1818
const workspaceFeatures: Record<BetaFeatures, boolean> = {
19-
noDubLink: false,
2019
analyticsSettingsSiteVisitTracking: false,
2120
};
2221

apps/web/lib/edge-config/is-reserved-username.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { get } from "@vercel/edge-config";
22

33
/**
4-
* Only for dub.sh / dub.link domains
4+
* Only for dub.sh domain
55
* Check if a username is reserved – should only be available on Pro+
66
*/
77
export const isReservedUsername = async (key: string) => {

apps/web/lib/swr/use-default-domains.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { fetcher } from "@dub/utils";
2-
import { useMemo } from "react";
32
import useSWR from "swr";
43
import useWorkspace from "./use-workspace";
54

65
export default function useDefaultDomains(opts: { search?: string } = {}) {
7-
const { id: workspaceId, flags } = useWorkspace();
6+
const { id: workspaceId } = useWorkspace();
87

98
const { data, error, mutate } = useSWR<string[]>(
109
workspaceId &&
@@ -18,14 +17,8 @@ export default function useDefaultDomains(opts: { search?: string } = {}) {
1817
},
1918
);
2019

21-
const defaultDomains = useMemo(() => {
22-
return flags?.noDubLink
23-
? data?.filter((domain) => domain !== "dub.link")
24-
: data;
25-
}, [data, flags]);
26-
2720
return {
28-
defaultDomains,
21+
defaultDomains: data,
2922
loading: !data && !error,
3023
mutate,
3124
error,

apps/web/lib/swr/use-domains.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ export default function useDomains({
8787
activeWorkspaceDomains.find(({ primary }) => primary)?.slug ||
8888
activeWorkspaceDomains[0].slug
8989
);
90-
} else if (activeDefaultDomains.find(({ slug }) => slug === "dub.link")) {
91-
return "dub.link";
9290
}
9391
return SHORT_DOMAIN;
9492
}, [activeDefaultDomains, activeWorkspaceDomains]);

apps/web/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export type UtmTemplateWithUserProps = UtmTemplateProps & {
260260

261261
export type PlanProps = (typeof plans)[number];
262262

263-
export type BetaFeatures = "noDubLink" | "analyticsSettingsSiteVisitTracking";
263+
export type BetaFeatures = "analyticsSettingsSiteVisitTracking";
264264

265265
export type PartnerBetaFeatures = "postbacks";
266266

apps/web/lib/zod/schemas/workspaces.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ export const WorkspaceSchema = z
102102
),
103103
dotLinkClaimed: z
104104
.boolean()
105-
.describe(
106-
"Whether the workspace has claimed a free .link domain. (dub.link/free)",
107-
),
105+
.describe("Whether the workspace has claimed a free .link domain."),
108106
createdAt: z
109107
.date()
110108
.describe("The date and time when the workspace was created."),

0 commit comments

Comments
 (0)