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.

remove loooooooong

Steven Tey6855e1e5fb11
diff --git a/apps/web/app/api/domains/default/route.ts b/apps/web/app/api/domains/default/route.ts
index 6863422c87..9a572df04d 100644
--- a/apps/web/app/api/domains/default/route.ts
+++ b/apps/web/app/api/domains/default/route.ts
@@ -51,7 +51,6 @@ export const PUT = withWorkspace(
amznid: defaultDomains.includes("amzn.id"),
ggllink: defaultDomains.includes("ggl.link"),
figpage: defaultDomains.includes("fig.page"),
- loooooooong: defaultDomains.includes("loooooooo.ng"),
},
});
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 ff397cba06..1a36344e45 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
@@ -40,7 +40,7 @@ function DubDomainsIcon(domain: string) {
}
export function DefaultDomains() {
- const { id, plan, role, flags } = useWorkspace();
+ const { id, plan, role } = useWorkspace();
const permissionsError = clientAccessCheck({
action: "domains.write",
role,
@@ -74,74 +74,76 @@ export function DefaultDomains() {
</p>
</div>
<div className="mt-2 grid grid-cols-1 gap-3">
- {DUB_DOMAINS.map(({ slug, description }) => {
- return (
- <div
- key={slug}
- className="flex items-center justify-between gap-4 rounded-xl border border-gray-200 bg-white p-5"
- >
- <DomainCardTitleColumn
- domain={slug}
- icon={DubDomainsIcon(slug)}
- description={description}
- defaultDomain
- />
- <Switch
- disabled={submitting}
- disabledTooltip={
- permissionsError ||
- (slug === "dub.link" && plan === "free" ? (
- <TooltipContent
- title="You can only use dub.link on a Pro plan and above. Upgrade to Pro to use this domain."
- cta="Upgrade to Pro"
- href={`/${slug}/upgrade`}
- />
- ) : undefined)
- }
- checked={defaultDomains?.includes(slug)}
- fn={() => {
- const oldDefaultDomains = defaultDomains.slice();
- const newDefaultDomains = defaultDomains.includes(slug)
- ? defaultDomains.filter((d) => d !== slug)
- : [...defaultDomains, slug];
+ {DUB_DOMAINS.filter((domain) => domain.slug !== "loooooooo.ng").map(
+ ({ slug, description }) => {
+ return (
+ <div
+ key={slug}
+ className="flex items-center justify-between gap-4 rounded-xl border border-gray-200 bg-white p-5"
+ >
+ <DomainCardTitleColumn
+ domain={slug}
+ icon={DubDomainsIcon(slug)}
+ description={description}
+ defaultDomain
+ />
+ <Switch
+ disabled={submitting}
+ disabledTooltip={
+ permissionsError ||
+ (slug === "dub.link" && plan === "free" ? (
+ <TooltipContent
+ title="You can only use dub.link on a Pro plan and above. Upgrade to Pro to use this domain."
+ cta="Upgrade to Pro"
+ href={`/${slug}/upgrade`}
+ />
+ ) : undefined)
+ }
+ checked={defaultDomains?.includes(slug)}
+ fn={() => {
+ const oldDefaultDomains = defaultDomains.slice();
+ const newDefaultDomains = defaultDomains.includes(slug)
+ ? defaultDomains.filter((d) => d !== slug)
+ : [...defaultDomains, slug];
- setDefaultDomains(newDefaultDomains);
- setSubmitting(true);
- fetch(`/api/domains/default?workspaceId=${id}`, {
- method: "PUT",
- body: JSON.stringify({
- defaultDomains: newDefaultDomains.filter(
- (d) => d !== null,
- ),
- }),
- })
- .then(async (res) => {
- if (res.ok) {
- toast.success(
- `${slug} ${newDefaultDomains.includes(slug) ? "added to" : "removed from"} default domains.`,
- );
- await mutate();
- } else {
- const { error } = await res.json();
- if (error.message.includes("Upgrade to Pro")) {
- toast.custom(() => (
- <UpgradeRequiredToast
- title="You've discovered a Pro feature!"
- message={error.message}
- />
- ));
+ setDefaultDomains(newDefaultDomains);
+ setSubmitting(true);
+ fetch(`/api/domains/default?workspaceId=${id}`, {
+ method: "PUT",
+ body: JSON.stringify({
+ defaultDomains: newDefaultDomains.filter(
+ (d) => d !== null,
+ ),
+ }),
+ })
+ .then(async (res) => {
+ if (res.ok) {
+ toast.success(
+ `${slug} ${newDefaultDomains.includes(slug) ? "added to" : "removed from"} default domains.`,
+ );
+ await mutate();
} else {
- toast.error(error.message);
+ const { error } = await res.json();
+ if (error.message.includes("Upgrade to Pro")) {
+ toast.custom(() => (
+ <UpgradeRequiredToast
+ title="You've discovered a Pro feature!"
+ message={error.message}
+ />
+ ));
+ } else {
+ toast.error(error.message);
+ }
+ setDefaultDomains(oldDefaultDomains);
}
- setDefaultDomains(oldDefaultDomains);
- }
- })
- .finally(() => setSubmitting(false));
- }}
- />
- </div>
- );
- })}
+ })
+ .finally(() => setSubmitting(false));
+ }}
+ />
+ </div>
+ );
+ },
+ )}
</div>
</div>
);
diff --git a/apps/web/lib/api/domains/get-default-domains.ts b/apps/web/lib/api/domains/get-default-domains.ts
index ef6b18bcfd..94cd17b731 100644
--- a/apps/web/lib/api/domains/get-default-domains.ts
+++ b/apps/web/lib/api/domains/get-default-domains.ts
@@ -18,7 +18,6 @@ export async function getDefaultDomains(
amznid: true,
ggllink: true,
figpage: true,
- loooooooong: true,
},
});