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 invoice payout period

Steven Teyd3882f357fbf
diff --git a/apps/web/app/app.dub.co/invoices/[invoiceId]/route.tsx b/apps/web/app/app.dub.co/invoices/[invoiceId]/route.tsx
index 1c6e355ea2..0f87f3d038 100644
--- a/apps/web/app/app.dub.co/invoices/[invoiceId]/route.tsx
+++ b/apps/web/app/app.dub.co/invoices/[invoiceId]/route.tsx
@@ -311,15 +311,21 @@ export const GET = withSession(async ({ session, params }) => {
<Text>{payout.partner.name}</Text>
</View>
<Text style={tw("w-2/6 p-3.5")}>
- {formatDate(payout.periodStart!, {
- month: "short",
- year:
- new Date(payout.periodStart!).getFullYear() ===
- new Date(payout.periodEnd!).getFullYear()
- ? undefined
- : "numeric",
- })}
- -{formatDate(payout.periodEnd!, { month: "short" })}
+ {payout.periodStart && payout.periodEnd ? (
+ <>
+ {formatDate(payout.periodStart, {
+ month: "short",
+ year:
+ new Date(payout.periodStart).getFullYear() ===
+ new Date(payout.periodEnd).getFullYear()
+ ? undefined
+ : "numeric",
+ })}
+ -{formatDate(payout.periodEnd, { month: "short" })}
+ </>
+ ) : (
+ "-"
+ )}
</Text>
<Text style={tw("w-1/6 p-3.5")}>{capitalize(payout.type)}</Text>
<Text style={tw("w-1/6 p-3.5")}>