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.

fix hold payouts count calculation

Steven Tey44ccff20efbc
diff --git a/apps/web/ui/partners/confirm-payouts-sheet.tsx b/apps/web/ui/partners/confirm-payouts-sheet.tsx
index 194c759c38..0bb29f1036 100644
--- a/apps/web/ui/partners/confirm-payouts-sheet.tsx
+++ b/apps/web/ui/partners/confirm-payouts-sheet.tsx
@@ -147,9 +147,13 @@ function ConfirmPayoutsSheetContent() {
return { holdPayoutsCount: 0, holdPayoutsAmount: 0 };
}
+ const pendingPayoutsCount = payoutsCount.find(
+ (p) => p.status === "pending",
+ );
+
return {
- holdPayoutsCount: payoutsCount[0].count,
- holdPayoutsAmount: payoutsCount[0].amount ?? 0,
+ holdPayoutsCount: pendingPayoutsCount?.count ?? 0,
+ holdPayoutsAmount: pendingPayoutsCount?.amount ?? 0,
};
}, [payoutsCount]);