aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/Settings.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-10-15 12:59:26 +0200
committerFlorian Dold <florian@dold.me>2022-10-15 12:59:26 +0200
commitbd88dcebbcf90414c790a86ee13740eaf20e3334 (patch)
tree3faa7508089bfa4316aebb310a7a5cf55076db34 /packages/taler-wallet-webextension/src/wallet/Settings.tsx
parente075134ffc94fda3582b179122bda594d91a962b (diff)
downloadwallet-core-bd88dcebbcf90414c790a86ee13740eaf20e3334.tar.xz
wallet-core: simplify exchanges list response
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Settings.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Settings.tsx22
1 files changed, 10 insertions, 12 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
index 80843ac27..8412c4a12 100644
--- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
@@ -14,7 +14,11 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { ExchangeListItem, WalletCoreVersion } from "@gnu-taler/taler-util";
+import {
+ ExchangeListItem,
+ ExchangeTosStatus,
+ WalletCoreVersion,
+} from "@gnu-taler/taler-util";
import { Fragment, h, VNode } from "preact";
import { Checkbox } from "../components/Checkbox.js";
import { ErrorTalerOperation } from "../components/ErrorTalerOperation.js";
@@ -36,7 +40,6 @@ import { useBackupDeviceName } from "../hooks/useBackupDeviceName.js";
import { useAutoOpenPermissions } from "../hooks/useAutoOpenPermissions.js";
import { ToggleHandler } from "../mui/handlers.js";
import { Pages } from "../NavigationBar.js";
-import { buildTermsOfServiceStatus } from "../components/TermsOfService/utils.js";
import * as wxApi from "../wxApi.js";
import { platform } from "../platform/api.js";
import { useClipboardPermissions } from "../hooks/useClipboardPermissions.js";
@@ -181,26 +184,21 @@ export function SettingsView({
<tbody>
{knownExchanges.map((e, idx) => {
function Status(): VNode {
- const status = buildTermsOfServiceStatus(
- e.tos.content,
- e.tos.acceptedVersion,
- e.tos.currentVersion,
- );
- switch (status) {
- case "accepted":
+ switch (e.tosStatus) {
+ case ExchangeTosStatus.Accepted:
return (
<SuccessText>
<i18n.Translate>ok</i18n.Translate>
</SuccessText>
);
- case "changed":
+ case ExchangeTosStatus.Changed:
return (
<WarningText>
<i18n.Translate>changed</i18n.Translate>
</WarningText>
);
- case "new":
- case "notfound":
+ case ExchangeTosStatus.New:
+ case ExchangeTosStatus.NotFound:
return (
<DestructiveText>
<i18n.Translate>not accepted</i18n.Translate>