diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts | 20 |
1 files changed, 14 insertions, 6 deletions
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, |