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.

Show an error in the Programs grid when the list fails to load

Rafi5c6287a2a097
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/page-client.tsx
index 2bcca79ced..556025877e 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/page-client.tsx
@@ -175,13 +175,21 @@ function ProgramsGridSkeleton() {
}
function ProgramsGrid({ tab, search }: { tab: ProgramTab; search?: string }) {
- const { programEnrollments, isLoading } = useProgramEnrollments({
+ const { programEnrollments, isLoading, error } = useProgramEnrollments({
// only the invite cards show the rewards and the discount
includeRewardsDiscounts: tab.id === "invitations",
status: tab.statuses.join(","),
search,
});
+ if (error) {
+ return (
+ <div className="py-10 text-center text-sm text-neutral-500">
+ Failed to load programs
+ </div>
+ );
+ }
+
return (
<div className="@md/page:grid-cols-2 @3xl/page:grid-cols-3 grid gap-4 p-4">
{isLoading || !programEnrollments