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 bounty-list.tsx

Tim Wilson64d399e754b6
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
index 966e2532dd..e347bbd922 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
@@ -14,7 +14,11 @@ export function BountyList() {
const { id: workspaceId } = useWorkspace();
const { setShowCreateBountySheet, BountySheet } = useBountySheet();
- const { data: bounties, isLoading } = useSWR<BountyExtendedProps[]>(
+ const {
+ data: bounties,
+ isLoading,
+ error,
+ } = useSWR<BountyExtendedProps[]>(
workspaceId ? `/api/bounties?workspaceId=${workspaceId}` : null,
fetcher,
{
@@ -25,7 +29,7 @@ export function BountyList() {
return (
<>
{BountySheet}
- {bounties?.length !== 0 || isLoading ? (
+ {Boolean(bounties?.length) || isLoading ? (
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3">
{isLoading
? Array.from({ length: 3 }, (_, index) => (
@@ -35,6 +39,12 @@ export function BountyList() {
<BountyCard key={bounty.id} bounty={bounty} />
))}
</div>
+ ) : error ? (
+ <div className="flex items-center justify-center px-4 py-8">
+ <p className="text-content-subtle text-sm">
+ Failed to load bounties.
+ </p>
+ </div>
) : (
<AnimatedEmptyState
title="No bounties active"