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.

Cal.link GA

Steven Teyd1dba90835aa
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
index e56167abdf..fa7890f2ff 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/domains/default-domains.tsx
@@ -78,9 +78,7 @@ export function DefaultDomains() {
</div>
<div className="mt-2 grid grid-cols-1 gap-3">
{DUB_DOMAINS.filter((domain) => {
- if (domain.slug === "cal.link") {
- return flags?.callink;
- } else if (domain.slug === "loooooooo.ng") {
+ if (domain.slug === "loooooooo.ng") {
return false;
}
return true;
diff --git a/apps/web/lib/api/links/process-link.ts b/apps/web/lib/api/links/process-link.ts
index bebfcd4d0d..e95e0d3689 100644
--- a/apps/web/lib/api/links/process-link.ts
+++ b/apps/web/lib/api/links/process-link.ts
@@ -1,8 +1,4 @@
-import {
- getFeatureFlags,
- isBlacklistedDomain,
- updateConfig,
-} from "@/lib/edge-config";
+import { isBlacklistedDomain, updateConfig } from "@/lib/edge-config";
import { getPangeaDomainIntel } from "@/lib/pangea";
import { checkIfUserExists, getRandomKey } from "@/lib/planetscale";
import { prisma } from "@/lib/prisma";
@@ -211,20 +207,6 @@ export async function processLink<T extends Record<string, any>>({
};
}
- if (domain === "cal.link") {
- const flags = await getFeatureFlags({
- workspaceId: workspace?.id,
- });
- if (!flags?.callink) {
- return {
- link: payload,
- error:
- "You can only use the cal.link domain if you have beta access to it. Contact [email protected] to get access.",
- code: "forbidden",
- };
- }
- }
-
if (!skipKeyChecks && key?.includes("/")) {
// check if the workspace has access to the parent link
const parentKey = key.split("/")[0];
diff --git a/apps/web/lib/edge-config/get-feature-flags.ts b/apps/web/lib/edge-config/get-feature-flags.ts
index 21fc3f8d21..e6d0be8cf4 100644
--- a/apps/web/lib/edge-config/get-feature-flags.ts
+++ b/apps/web/lib/edge-config/get-feature-flags.ts
@@ -17,7 +17,6 @@ export const getFeatureFlags = async ({
}
const workspaceFeatures: Record<BetaFeatures, boolean> = {
- callink: false,
referrals: false,
webhooks: false,
};
diff --git a/apps/web/lib/swr/use-default-domains.ts b/apps/web/lib/swr/use-default-domains.ts
index 1177f2dca6..5aee474b00 100644
--- a/apps/web/lib/swr/use-default-domains.ts
+++ b/apps/web/lib/swr/use-default-domains.ts
@@ -1,15 +1,14 @@
import { fetcher } from "@dub/utils";
-import { useMemo } from "react";
import useSWR from "swr";
import useWorkspace from "./use-workspace";
export default function useDefaultDomains(opts: { search?: string } = {}) {
- const { id, flags } = useWorkspace();
+ const { id: workspaceId } = useWorkspace();
const { data, error, mutate } = useSWR<string[]>(
- id &&
+ workspaceId &&
`/api/domains/default?${new URLSearchParams({
- workspaceId: id,
+ workspaceId,
...(opts.search && { search: opts.search }),
}).toString()}`,
fetcher,
@@ -18,14 +17,8 @@ export default function useDefaultDomains(opts: { search?: string } = {}) {
},
);
- const defaultDomains = useMemo(() => {
- return flags && !flags.callink
- ? data?.filter((d) => d !== "cal.link")
- : data;
- }, [data, flags]);
-
return {
- defaultDomains,
+ defaultDomains: data,
loading: !data && !error,
mutate,
error,
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 91149e924a..b0e8fbffe5 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -71,7 +71,7 @@ export type PlanProps = (typeof plans)[number];
export type RoleProps = (typeof roles)[number];
-export type BetaFeatures = "callink" | "referrals" | "webhooks";
+export type BetaFeatures = "referrals" | "webhooks";
export type AddOns = "conversion" | "sso";