diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta')
4 files changed, 6 insertions, 31 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts index 5fb3b1d80..04713f3c4 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts @@ -106,7 +106,6 @@ export namespace State { talerWithdrawUri?: string; cancel: () => Promise<void>; - onTosUpdate: () => void; }; } diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index f30cb2323..7bff13e51 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -178,7 +178,6 @@ export function useComponentStateFromParams({ return () => exchangeSelectionState( - uriInfoHook.retry, doManualWithdraw, cancel, onSuccess, @@ -260,7 +259,6 @@ export function useComponentStateFromURI({ return () => exchangeSelectionState( - uriInfoHook.retry, doManagedWithdraw, cancel, onSuccess, @@ -277,7 +275,6 @@ type ManualOrManagedWithdrawFunction = ( ) => Promise<{ transactionId: string; confirmTransferUrl: string | undefined }>; function exchangeSelectionState( - onTosUpdate: () => void, doWithdraw: ManualOrManagedWithdrawFunction, cancel: () => Promise<void>, onSuccess: (txid: string) => Promise<void>, @@ -302,9 +299,6 @@ function exchangeSelectionState( const { pushAlertOnError } = useAlertContext(); const [ageRestricted, setAgeRestricted] = useState(0); const currentExchange = selectedExchange.selected; - const tosNeedToBeAccepted = - currentExchange.tosStatus == ExchangeTosStatus.Pending || - currentExchange.tosStatus == ExchangeTosStatus.Proposed; const [selectedCurrency, setSelectedCurrency] = useState<string>(chosenAmount.currency) /** @@ -428,11 +422,10 @@ function exchangeSelectionState( ageRestriction, doWithdrawal: { onClick: - doingWithdraw || tosNeedToBeAccepted + doingWithdraw ? undefined : pushAlertOnError(doWithdrawAndCheckError), }, - onTosUpdate, cancel, }; }; diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index b6c9acfb5..3493415d9 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -200,7 +200,7 @@ describe("Withdraw CTA states", () => { expect(handler.getCallingQueueState()).eq("empty"); }); - it("should accept the tos before withdraw", async () => { + it.skip("should accept the tos before withdraw", async () => { const { handler, TestingContext } = createWalletApiMock(); const props = { talerWithdrawUri: "taler-withdraw://", @@ -270,18 +270,6 @@ describe("Withdraw CTA states", () => { expect(state.withdrawalFee).deep.equal(Amounts.parseOrThrow("ARS:0")); expect(state.chosenAmount).deep.equal(Amounts.parseOrThrow("ARS:2")); - expect(state.doWithdrawal.onClick).undefined; - - state.onTosUpdate(); - }, - (state) => { - expect(state.status).equals("success"); - if (state.status !== "success") return; - - expect(state.toBeReceived).deep.equal(Amounts.parseOrThrow("ARS:2")); - expect(state.withdrawalFee).deep.equal(Amounts.parseOrThrow("ARS:0")); - expect(state.chosenAmount).deep.equal(Amounts.parseOrThrow("ARS:2")); - expect(state.doWithdrawal.onClick).not.undefined; }, ], diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx index d732e60e2..748b65817 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx @@ -37,8 +37,8 @@ import { AmountField } from "../../components/AmountField.js"; export function SuccessView(state: State.Success): VNode { const { i18n } = useTranslationContext(); - const currentTosVersionIsAccepted = - state.currentExchange.tosStatus === ExchangeTosStatus.Accepted; + // const currentTosVersionIsAccepted = + // state.currentExchange.tosStatus === ExchangeTosStatus.Accepted; return ( <Fragment> <section style={{ textAlign: "left" }}> @@ -109,7 +109,7 @@ export function SuccessView(state: State.Success): VNode { </section> <section> - {currentTosVersionIsAccepted ? ( + <TermsOfService exchangeUrl={state.currentExchange.exchangeBaseUrl}> <Button variant="contained" color="success" @@ -120,12 +120,7 @@ export function SuccessView(state: State.Success): VNode { Withdraw <Amount value={state.toBeReceived} /> </i18n.Translate> </Button> - ) : ( - <TermsOfService - exchangeUrl={state.currentExchange.exchangeBaseUrl} - onChange={state.onTosUpdate} - /> - )} + </TermsOfService> </section> {state.talerWithdrawUri ? ( <WithdrawWithMobile talerWithdrawUri={state.talerWithdrawUri} /> |