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.

Update share-dashboard-modal.tsx

Steven Teya0c879819797
diff --git a/apps/web/ui/modals/share-dashboard-modal.tsx b/apps/web/ui/modals/share-dashboard-modal.tsx
index f7800d5a47..65db3bb119 100644
--- a/apps/web/ui/modals/share-dashboard-modal.tsx
+++ b/apps/web/ui/modals/share-dashboard-modal.tsx
@@ -94,11 +94,13 @@ function ShareDashboardModalInner({
);
const { data: dashboard, mutate } = useSWR<DashboardProps>(
- linkId || link?.id
- ? `/api/links/${linkId || link?.id}/dashboard?workspaceId=${workspaceId}`
- : folder?.id
- ? `/api/folders/${folder.id}/dashboard?workspaceId=${workspaceId}`
- : undefined,
+ !workspaceId
+ ? undefined
+ : linkId || link?.id
+ ? `/api/links/${linkId || link?.id}/dashboard?workspaceId=${workspaceId}`
+ : folder?.id
+ ? `/api/folders/${folder.id}/dashboard?workspaceId=${workspaceId}`
+ : undefined,
fetcher,
{
dedupingInterval: 60000,