diff options
author | Sebastian <sebasjm@gmail.com> | 2022-04-06 12:20:00 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-04-06 12:20:14 -0300 |
commit | f300850b19f8b4084bfac88a4cfd06e43bc75a8e (patch) | |
tree | 2086e63c58385f8b78798881e386db2590fbb32f /packages/taler-wallet-webextension/src/cta/Pay.tsx | |
parent | bb56d61424c5e02feaec487b1c437e52a9f1e23c (diff) | |
download | wallet-core-f300850b19f8b4084bfac88a4cfd06e43bc75a8e.tar.xz |
cta stories and input filled mui
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Pay.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Pay.tsx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx b/packages/taler-wallet-webextension/src/cta/Pay.tsx index 13fb69853..359625999 100644 --- a/packages/taler-wallet-webextension/src/cta/Pay.tsx +++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx @@ -105,6 +105,23 @@ export function PayPage({ return { payStatus, balance }; }, [NotificationType.CoinWithdrawn]); + useEffect(() => { + const payStatus = + hook && !hook.hasError ? hook.response.payStatus : undefined; + if ( + payStatus && + payStatus.status === PreparePayResultType.AlreadyConfirmed && + payStatus.paid + ) { + const fu = payStatus.contractTerms.fulfillment_url; + if (fu) { + setTimeout(() => { + document.location.href = fu; + }, 3000); + } + } + }, []); + if (!hook) { return <Loading />; } @@ -172,20 +189,6 @@ export function PaymentRequestView({ let totalFees: AmountJson = Amounts.getZero(payStatus.amountRaw); const contractTerms: ContractTerms = payStatus.contractTerms; - useEffect(() => { - if ( - payStatus.status === PreparePayResultType.AlreadyConfirmed && - payStatus.paid - ) { - const fu = payStatus.contractTerms.fulfillment_url; - if (fu) { - setTimeout(() => { - document.location.href = fu; - }, 3000); - } - } - }); - if (!contractTerms) { return ( <ErrorMessage |