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 use-bounty-submissions-count.ts

Kiran Kfac0fdbce06d
diff --git a/apps/web/lib/swr/use-bounty-submissions-count.ts b/apps/web/lib/swr/use-bounty-submissions-count.ts
index 99b7363cab..1ed0710125 100644
--- a/apps/web/lib/swr/use-bounty-submissions-count.ts
+++ b/apps/web/lib/swr/use-bounty-submissions-count.ts
@@ -17,8 +17,10 @@ export function useBountySubmissionsCount<T>({
const { id: workspaceId } = useWorkspace();
const { getQueryString } = useRouterStuff();
+ const shouldFetch = Boolean(enabled && workspaceId);
+
const { data: submissionsCount, error } = useSWR<T>(
- enabled
+ shouldFetch
? `/api/bounties/count${getQueryString({
workspaceId,
})}`