From 976ef62965ad394424ea3906a22b67472ae7f261 Mon Sep 17 00:00:00 2001 From: Nullptrderef Date: Sat, 15 Jun 2024 18:37:21 +0200 Subject: hotfix - why is this undefined lol --- packages/bank-ui/src/pages/SolveChallengePage.tsx | 20 +++++++++---- packages/bank-ui/src/pages/WithdrawalQRCode.tsx | 35 +++++++++++++---------- 2 files changed, 35 insertions(+), 20 deletions(-) (limited to 'packages/bank-ui/src/pages') diff --git a/packages/bank-ui/src/pages/SolveChallengePage.tsx b/packages/bank-ui/src/pages/SolveChallengePage.tsx index 624890468..6d22d8da7 100644 --- a/packages/bank-ui/src/pages/SolveChallengePage.tsx +++ b/packages/bank-ui/src/pages/SolveChallengePage.tsx @@ -206,7 +206,12 @@ export function SolveChallengePage({ case "update-password": return await api.updatePassword(creds, ch.request, ch.id); case "create-transaction": - return await api.createTransaction(creds, ch.request, undefined, ch.id); + return await api.createTransaction( + creds, + ch.request, + undefined, + ch.id, + ); case "confirm-withdrawal": return await api.confirmWithdrawalById(creds, ch.request, ch.id); case "create-cashout": @@ -694,10 +699,15 @@ function ShowWithdrawalDetails({ id }: { id: string }): VNode {
Amount
- + {/* FIXME: THIS IS STUPID! We need to fix the reason why details.body.amount could be undefined here! */} + {details.body.amount !== undefined ? ( + + ) : ( + "Unable to find the amount." + )}
{details.body.selected_reserve_pub !== undefined && ( diff --git a/packages/bank-ui/src/pages/WithdrawalQRCode.tsx b/packages/bank-ui/src/pages/WithdrawalQRCode.tsx index b61f0cc8f..6901c2a87 100644 --- a/packages/bank-ui/src/pages/WithdrawalQRCode.tsx +++ b/packages/bank-ui/src/pages/WithdrawalQRCode.tsx @@ -232,21 +232,26 @@ export function WithdrawalQRCode({ } return ( - { - notifyInfo(i18n.str`Operation canceled`); - onOperationAborted(); - }} - /> + /* FIXME: THIS IS STUPID! We need to fix the reason why data.amount could be undefined here! */ + data.amount !== undefined ? ( + { + notifyInfo(i18n.str`Operation canceled`); + onOperationAborted(); + }} + /> + ) : ( +

Unable to find the amount.

+ ) ); } -- cgit v1.2.3