aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorNullptrderef <nullptrderef@proton.me>2024-06-15 18:37:21 +0200
committerNullptrderef <nullptrderef@proton.me>2024-06-15 18:37:21 +0200
commit976ef62965ad394424ea3906a22b67472ae7f261 (patch)
tree6f7ecc8837200ac6cff872cc5c99ea50d7316a17 /packages
parentcf929379bc2b09222817fbbd7063d0b31fc00add (diff)
downloadwallet-core-976ef62965ad394424ea3906a22b67472ae7f261.tar.xz
hotfix - why is this undefined lol
Diffstat (limited to 'packages')
-rw-r--r--packages/bank-ui/src/pages/SolveChallengePage.tsx20
-rw-r--r--packages/bank-ui/src/pages/WithdrawalQRCode.tsx35
2 files changed, 35 insertions, 20 deletions
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 {
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
<dt class="text-sm font-medium leading-6 text-gray-900">Amount</dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
- <RenderAmount
- value={Amounts.parseOrThrow(details.body.amount)}
- spec={config.currency_specification}
- />
+ {/* FIXME: THIS IS STUPID! We need to fix the reason why details.body.amount could be undefined here! */}
+ {details.body.amount !== undefined ? (
+ <RenderAmount
+ value={Amounts.parseOrThrow(details.body.amount)}
+ spec={config.currency_specification}
+ />
+ ) : (
+ "Unable to find the amount."
+ )}
</dd>
</div>
{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 (
- <WithdrawalConfirmationQuestion
- withdrawUri={withdrawUri}
- routeHere={routeWithdrawalDetails}
- details={{
- username: data.username,
- account,
- reserve: data.selected_reserve_pub,
- amount: Amounts.parseOrThrow(data.amount),
- }}
- onAuthorizationRequired={onAuthorizationRequired}
- onAborted={() => {
- 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 ? (
+ <WithdrawalConfirmationQuestion
+ withdrawUri={withdrawUri}
+ routeHere={routeWithdrawalDetails}
+ details={{
+ username: data.username,
+ account,
+ reserve: data.selected_reserve_pub,
+ amount: Amounts.parseOrThrow(data.amount),
+ }}
+ onAuthorizationRequired={onAuthorizationRequired}
+ onAborted={() => {
+ notifyInfo(i18n.str`Operation canceled`);
+ onOperationAborted();
+ }}
+ />
+ ) : (
+ <p>Unable to find the amount.</p>
+ )
);
}