From bd88dcebbcf90414c790a86ee13740eaf20e3334 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 15 Oct 2022 12:59:26 +0200 Subject: wallet-core: simplify exchanges list response --- .../taler-wallet-webextension/src/cta/Withdraw/state.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/state.ts') diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 53bac579e..f4aea9cd6 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -15,7 +15,12 @@ */ /* eslint-disable react-hooks/rules-of-hooks */ -import { AmountJson, Amounts, ExchangeListItem } from "@gnu-taler/taler-util"; +import { + AmountJson, + Amounts, + ExchangeListItem, + ExchangeTosStatus, +} from "@gnu-taler/taler-util"; import { TalerError } from "@gnu-taler/taler-wallet-core"; import { useState } from "preact/hooks"; import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js"; @@ -173,10 +178,8 @@ function exchangeSelectionState( const [ageRestricted, setAgeRestricted] = useState(0); const currentExchange = selectedExchange.selected; const tosNeedToBeAccepted = - !currentExchange.tos.acceptedVersion || - currentExchange.tos.currentVersion !== - currentExchange.tos.acceptedVersion; - + currentExchange.tosStatus == ExchangeTosStatus.New || + currentExchange.tosStatus == ExchangeTosStatus.Changed; /** * With the exchange and amount, ask the wallet the information * about the withdrawal -- cgit v1.2.3