aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/ExchangeSelection
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-12-15 17:12:03 -0300
committerSebastian <sebasjm@gmail.com>2022-12-15 17:12:03 -0300
commitf1f8f818dbe631fbeeba64af9dfcae1aa7842615 (patch)
tree856d3b443556ce271c3e9fdab6aed7ae7728ab65 /packages/taler-wallet-webextension/src/wallet/ExchangeSelection
parentf93bd51499ed34844b666bf6d333227adf4368bf (diff)
downloadwallet-core-f1f8f818dbe631fbeeba64af9dfcae1aa7842615.tar.xz
pretty
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeSelection')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts4
-rw-r--r--packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts21
2 files changed, 14 insertions, 11 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts
index 661fa5286..1bb4fb314 100644
--- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts
+++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts
@@ -18,7 +18,7 @@ import {
DenomOperationMap,
ExchangeFullDetails,
ExchangeListItem,
- FeeDescriptionPair
+ FeeDescriptionPair,
} from "@gnu-taler/taler-util";
import { Loading } from "../../components/Loading.js";
import { HookError } from "../../hooks/useAsyncAsHook.js";
@@ -32,7 +32,7 @@ import {
NoExchangesView,
PrivacyContentView,
ReadyView,
- TosContentView
+ TosContentView,
} from "./views.js";
export interface Props {
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts
index 585050413..378556b94 100644
--- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts
+++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts
@@ -17,17 +17,20 @@
import { DenomOperationMap, FeeDescription } from "@gnu-taler/taler-util";
import {
createPairTimeline,
- WalletApiOperation
+ WalletApiOperation,
} from "@gnu-taler/taler-wallet-core";
import { useState } from "preact/hooks";
import { useBackendContext } from "../../context/backend.js";
import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
import { Props, State } from "./index.js";
-export function useComponentState(
- { onCancel, onSelection, list: exchanges, currentExchange }: Props,
-): State {
- const api = useBackendContext()
+export function useComponentState({
+ onCancel,
+ onSelection,
+ list: exchanges,
+ currentExchange,
+}: Props): State {
+ const api = useBackendContext();
const initialValue = exchanges.findIndex(
(e) => e.exchangeBaseUrl === currentExchange,
);
@@ -52,14 +55,14 @@ export function useComponentState(
const selected = !selectedExchange
? undefined
: await api.wallet.call(WalletApiOperation.GetExchangeDetailedInfo, {
- exchangeBaseUrl: selectedExchange.exchangeBaseUrl,
- });
+ exchangeBaseUrl: selectedExchange.exchangeBaseUrl,
+ });
const original = !initialExchange
? undefined
: await api.wallet.call(WalletApiOperation.GetExchangeDetailedInfo, {
- exchangeBaseUrl: initialExchange.exchangeBaseUrl,
- });
+ exchangeBaseUrl: initialExchange.exchangeBaseUrl,
+ });
return {
exchanges,