Skip to content

Commit de56751

Browse files
authored
fix(clerk-js): Add check for error on Statement page and Payment Attempt page (#6431)
1 parent af0e123 commit de56751

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.changeset/new-lands-make.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ export const PaymentAttemptPage = () => {
9090
variant='danger'
9191
colorScheme='danger'
9292
>
93-
{translateError(error.errors[0]) ||
94-
t(localizationKeys(`${localizationRoot}.billingPage.paymentHistorySection.notFound`))}
93+
{error
94+
? translateError(error.errors[0])
95+
: t(localizationKeys(`${localizationRoot}.billingPage.paymentHistorySection.notFound`))}
9596
</Alert>
9697
</Box>
9798
) : (

packages/clerk-js/src/ui/components/Statements/StatementPage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ export const StatementPage = () => {
8585
variant='danger'
8686
colorScheme='danger'
8787
>
88-
{translateError(error.errors[0]) ||
89-
t(localizationKeys(`${localizationRoot}.billingPage.statementsSection.notFound`))}
88+
{error
89+
? translateError(error.errors[0])
90+
: t(localizationKeys(`${localizationRoot}.billingPage.statementsSection.notFound`))}
9091
</Alert>
9192
</Box>
9293
) : (

0 commit comments

Comments
 (0)