diff options
author | Florian Dold <florian@dold.me> | 2022-10-15 12:59:26 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-15 12:59:26 +0200 |
commit | bd88dcebbcf90414c790a86ee13740eaf20e3334 (patch) | |
tree | 3faa7508089bfa4316aebb310a7a5cf55076db34 /packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | |
parent | e075134ffc94fda3582b179122bda594d91a962b (diff) | |
download | wallet-core-bd88dcebbcf90414c790a86ee13740eaf20e3334.tar.xz |
wallet-core: simplify exchanges list response
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 13 |
1 files changed, 8 insertions, 5 deletions
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 |