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.

improve getLinksForWorkspace for isMegaWorkspace

Steven Tey3f82ceb413c2
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
index e629aa7d3d..11f233a925 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
@@ -229,10 +229,7 @@ function WorkspaceLinks() {
</div>
{isLoading ? (
- <div className="flex grow-0 animate-pulse items-center space-x-2">
- <div className="h-10 w-24 rounded-md bg-neutral-200" />
- <div className="h-10 w-10 rounded-md bg-neutral-200" />
- </div>
+ <div className="h-10 w-[2.125rem] animate-pulse rounded-md bg-neutral-200" />
) : canCreateLinks ? (
<MoreLinkOptions />
) : (
diff --git a/apps/web/lib/api/links/get-links-for-workspace.ts b/apps/web/lib/api/links/get-links-for-workspace.ts
index cf8c3f9201..37196606e0 100644
--- a/apps/web/lib/api/links/get-links-for-workspace.ts
+++ b/apps/web/lib/api/links/get-links-for-workspace.ts
@@ -104,7 +104,9 @@ export async function getLinksForWorkspace({
],
}),
...(searchMode === "exact" && {
- shortLink: { startsWith: search },
+ [search.startsWith("https://") ? "shortLink" : "key"]: {
+ startsWith: search,
+ },
}),
},
]