summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-04-21 14:23:53 -0300
committerSebastian <sebasjm@gmail.com>2022-04-21 14:23:53 -0300
commit64acf8e2b1083de6f78b7d21dd2701af2fee1911 (patch)
tree8f48df244fa2299ea68711a3aeb91da955dc8040 /packages/taler-wallet-webextension/src/cta/Withdraw.tsx
parent8e29f91a56af962404c9a30868d6c3a21997ba57 (diff)
downloadwallet-core-64acf8e2b1083de6f78b7d21dd2701af2fee1911.tar.gz
wallet-core-64acf8e2b1083de6f78b7d21dd2701af2fee1911.tar.bz2
wallet-core-64acf8e2b1083de6f78b7d21dd2701af2fee1911.zip
payments test case
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw.tsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 64059f721..2293d6508 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -119,7 +119,7 @@ export function useComponentState(
const uriHookDep =
!uriInfoHook || uriInfoHook.hasError || !uriInfoHook.response
? undefined
- : uriInfoHook;
+ : uriInfoHook.response;
const { amount, thisExchange, thisCurrencyExchanges } = useMemo(() => {
if (!uriHookDep)
@@ -129,7 +129,7 @@ export function useComponentState(
thisCurrencyExchanges: [],
};
- const { uriInfo, knownExchanges } = uriHookDep.response;
+ const { uriInfo, knownExchanges } = uriHookDep;
const amount = uriInfo ? Amounts.parseOrThrow(uriInfo.amount) : undefined;
const thisCurrencyExchanges =
@@ -324,9 +324,11 @@ export function useComponentState(
withdrawalFee,
chosenAmount: amount,
doWithdrawal: {
- onClick: doWithdrawAndCheckError,
+ onClick:
+ doingWithdraw || (mustAcceptFirst && !reviewed)
+ ? undefined
+ : doWithdrawAndCheckError,
error: withdrawError,
- disabled: doingWithdraw || (mustAcceptFirst && !reviewed),
},
tosProps: !termsState
? undefined
@@ -427,7 +429,7 @@ export function View({ state }: { state: Success }): VNode {
(state.mustAcceptFirst && state.tosProps.reviewed)) && (
<ButtonSuccess
upperCased
- disabled={state.doWithdrawal.disabled}
+ disabled={!state.doWithdrawal.onClick}
onClick={state.doWithdrawal.onClick}
>
<i18n.Translate>Confirm withdrawal</i18n.Translate>
@@ -436,7 +438,7 @@ export function View({ state }: { state: Success }): VNode {
{state.tosProps.terms.status === "notfound" && (
<ButtonWarning
upperCased
- disabled={state.doWithdrawal.disabled}
+ disabled={!state.doWithdrawal.onClick}
onClick={state.doWithdrawal.onClick}
>
<i18n.Translate>Withdraw anyway</i18n.Translate>