From f1f8f818dbe631fbeeba64af9dfcae1aa7842615 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 15 Dec 2022 17:12:03 -0300 Subject: pretty --- .../src/cta/Withdraw/state.ts | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 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 4420221fc..1ecf05eca 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -19,7 +19,7 @@ import { AmountJson, Amounts, ExchangeListItem, - ExchangeTosStatus + ExchangeTosStatus, } from "@gnu-taler/taler-util"; import { TalerError, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useState } from "preact/hooks"; @@ -29,10 +29,12 @@ import { useSelectedExchange } from "../../hooks/useSelectedExchange.js"; import { RecursiveState } from "../../utils/index.js"; import { PropsFromParams, PropsFromURI, State } from "./index.js"; -export function useComponentStateFromParams( - { amount, cancel, onSuccess }: PropsFromParams, -): RecursiveState { - const api = useBackendContext() +export function useComponentStateFromParams({ + amount, + cancel, + onSuccess, +}: PropsFromParams): RecursiveState { + const api = useBackendContext(); const uriInfoHook = useAsyncAsHook(async () => { const exchanges = await api.wallet.call( WalletApiOperation.ListExchanges, @@ -87,10 +89,12 @@ export function useComponentStateFromParams( ); } -export function useComponentStateFromURI( - { talerWithdrawUri, cancel, onSuccess }: PropsFromURI, -): RecursiveState { - const api = useBackendContext() +export function useComponentStateFromURI({ + talerWithdrawUri, + cancel, + onSuccess, +}: PropsFromURI): RecursiveState { + const api = useBackendContext(); /** * Ask the wallet about the withdraw URI */ @@ -175,7 +179,7 @@ function exchangeSelectionState( exchangeList: ExchangeListItem[], defaultExchange: string | undefined, ): RecursiveState { - const api = useBackendContext() + const api = useBackendContext(); const selectedExchange = useSelectedExchange({ currency: chosenAmount.currency, defaultExchange, @@ -276,10 +280,10 @@ function exchangeSelectionState( //TODO: calculate based on exchange info const ageRestriction = ageRestrictionEnabled ? { - list: ageRestrictionOptions, - value: String(ageRestricted), - onChange: async (v: string) => setAgeRestricted(parseInt(v, 10)), - } + list: ageRestrictionOptions, + value: String(ageRestricted), + onChange: async (v: string) => setAgeRestricted(parseInt(v, 10)), + } : undefined; return { -- cgit v1.2.3