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.

isProgramLink → isProgramLinkWithLeads

Steven Tey7299427274a4
diff --git a/apps/web/app/api/links/bulk/route.ts b/apps/web/app/api/links/bulk/route.ts
index 6a01903fcf..0bfc4a5c68 100644
--- a/apps/web/app/api/links/bulk/route.ts
+++ b/apps/web/app/api/links/bulk/route.ts
@@ -499,7 +499,6 @@ export const DELETE = withWorkspace(
let links = await prisma.link.findMany({
where: {
projectId: workspace.id,
- programId: null,
OR: [
...(linkIds.size > 0 ? [{ id: { in: Array.from(linkIds) } }] : []),
...(externalIds.size > 0
diff --git a/apps/web/ui/links/link-analytics-badge.tsx b/apps/web/ui/links/link-analytics-badge.tsx
index efeecd9d5e..99dfa48685 100644
--- a/apps/web/ui/links/link-analytics-badge.tsx
+++ b/apps/web/ui/links/link-analytics-badge.tsx
@@ -98,6 +98,7 @@ export function LinkAnalyticsBadge({
<Tooltip
key={modalShowCount}
side="top"
+ delayDuration={500}
content={
<div className="flex flex-col gap-2.5 whitespace-nowrap p-3 text-neutral-600">
{stats.map(({ id: tab, value }) => (
diff --git a/apps/web/ui/links/link-controls.tsx b/apps/web/ui/links/link-controls.tsx
index 7c8ae2235f..d3bdbf09ad 100644
--- a/apps/web/ui/links/link-controls.tsx
+++ b/apps/web/ui/links/link-controls.tsx
@@ -99,7 +99,7 @@ export function LinkControls({
useMoveLinkToFolderModal({ link, onSuccess: onMoveSuccess });
const isRootLink = link.key === "_root";
- const isProgramLink = link.programId !== null;
+ const isProgramLinkWithLeads = link.programId !== null && link.leads > 0;
const folderId = link.folderId || searchParams.get("folderId");
// Duplicate link Modal
@@ -178,7 +178,7 @@ export function LinkControls({
case "x":
canManageLink &&
!isRootLink &&
- !isProgramLink &&
+ !isProgramLinkWithLeads &&
setShowDeleteLinkModal(true);
break;
case "b":
@@ -343,14 +343,14 @@ export function LinkControls({
icon={<Delete className="size-4" />}
shortcut="X"
className="h-9 px-2 font-medium"
- disabled={isRootLink || isProgramLink}
+ disabled={isRootLink || isProgramLinkWithLeads}
disabledTooltip={
!canManageLink
? "You don't have permission to delete this link."
: isRootLink
? "You can't delete a custom domain link. You can delete the domain instead."
- : isProgramLink
- ? "You can't delete a link that's part of a program."
+ : isProgramLinkWithLeads
+ ? "You can't delete a partner link that has existing leads. We recommend archiving it instead."
: undefined
}
/>