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.

Add comments

Tim Wilson8037d63475d4
diff --git a/apps/web/ui/webhooks/link-selector.tsx b/apps/web/ui/webhooks/link-selector.tsx
index 93a8a39860..8491d05146 100644
--- a/apps/web/ui/webhooks/link-selector.tsx
+++ b/apps/web/ui/webhooks/link-selector.tsx
@@ -64,11 +64,14 @@ export function LinksSelector({
[selectedLinkIds, links, selectedLinks],
);
+ // Calculate how many additional links are not displayed:
const plusCount =
selectedLinkIds.length > selectedOptions.length
- ? selectedLinkIds.length -
+ ? // Case 1: Selected IDs without loaded links
+ selectedLinkIds.length -
Math.min(selectedOptions.length, MAX_DISPLAYED_LINKS)
- : Math.max(0, selectedOptions.length - MAX_DISPLAYED_LINKS);
+ : // Case 2: More selected options than display limit
+ Math.max(0, selectedOptions.length - MAX_DISPLAYED_LINKS);
return (
<Combobox