diff options
author | Sebastian <sebasjm@gmail.com> | 2022-11-16 16:04:52 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-11-16 16:05:13 -0300 |
commit | 1a63d56bfdd091cc7aefdf1e25f3a074bfdf5e0e (patch) | |
tree | 7255cf4a5b51af4807e2a01a370497413a78968f /packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts | |
parent | 53164dc47b1138235a0c797affaa6fb37ea43239 (diff) | |
download | wallet-core-1a63d56bfdd091cc7aefdf1e25f3a074bfdf5e0e.tar.xz |
fix #7411, also making the backup payment visible
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index 457827127..1846794fc 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -21,7 +21,7 @@ import { PreparePayResult, PreparePayResultType, TalerErrorDetail, - TalerProtocolTimestamp + TalerProtocolTimestamp, } from "@gnu-taler/taler-util"; import { TalerError, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useEffect, useState } from "preact/hooks"; @@ -41,10 +41,12 @@ export function useComponentState( return { p2p, balance }; }); - useEffect(() => api.listener.onUpdateNotification( - [NotificationType.CoinWithdrawn], - hook?.retry - )); + useEffect(() => + api.listener.onUpdateNotification( + [NotificationType.CoinWithdrawn], + hook?.retry, + ), + ); const [operationError, setOperationError] = useState< TalerErrorDetail | undefined @@ -63,10 +65,7 @@ export function useComponentState( }; } - const { - contractTerms, - peerPullPaymentIncomingId, - } = hook.response.p2p; + const { contractTerms, peerPullPaymentIncomingId } = hook.response.p2p; const amountStr: string = contractTerms?.amount; const amount = Amounts.parseOrThrow(amountStr); @@ -134,9 +133,12 @@ export function useComponentState( async function accept(): Promise<void> { try { - const resp = await api.wallet.call(WalletApiOperation.AcceptPeerPullPayment, { - peerPullPaymentIncomingId, - }); + const resp = await api.wallet.call( + WalletApiOperation.AcceptPeerPullPayment, + { + peerPullPaymentIncomingId, + }, + ); onSuccess(resp.transactionId); } catch (e) { if (e instanceof TalerError) { |