From ff9c67c72d8939560f9b5619ae2210841acdf01c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 20 Feb 2023 11:32:34 -0300 Subject: fix #7579 --- .../src/cta/InvoicePay/state.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts') diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index 5ffc78ece..7d8089814 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -76,13 +76,20 @@ export function useComponentState({ // }; // } - const { contractTerms, peerPullPaymentIncomingId } = hook.response.p2p; - - const amountStr: string = contractTerms?.amount; + const { + contractTerms, + peerPullPaymentIncomingId, + amountEffective, + amountRaw, + } = hook.response.p2p; + + const amountStr: string = contractTerms.amount; const amount = Amounts.parseOrThrow(amountStr); - const summary: string | undefined = contractTerms?.summary; + const effective = Amounts.parseOrThrow(amountEffective); + const raw = Amounts.parseOrThrow(amountRaw); + const summary: string | undefined = contractTerms.summary; const expiration: TalerProtocolTimestamp | undefined = - contractTerms?.purse_expiration; + contractTerms.purse_expiration; const foundBalance = hook.response.balance.balances.find( (b) => Amounts.parseOrThrow(b.available).currency === amount.currency, @@ -112,7 +119,8 @@ export function useComponentState({ cancel: { onClick: pushAlertOnError(onClose), }, - amount, + effective, + raw, goToWalletManualWithdraw, summary, expiration: expiration ? AbsoluteTime.fromTimestamp(expiration) : undefined, -- cgit v1.2.3