diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts index a95830f8e..d711f1ecc 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/index.ts @@ -20,16 +20,16 @@ import { ExchangeListItem, FeeDescriptionPair, } from "@gnu-taler/taler-util"; +import { ErrorAlertView } from "../../components/CurrentAlerts.js"; import { Loading } from "../../components/Loading.js"; +import { ErrorAlert } from "../../context/alert.js"; import { HookError } from "../../hooks/useAsyncAsHook.js"; import { State as SelectExchangeState } from "../../hooks/useSelectedExchange.js"; import { ButtonHandler, SelectFieldHandler } from "../../mui/handlers.js"; import { compose, StateViewMap } from "../../utils/index.js"; -import { wxApi } from "../../wxApi.js"; import { useComponentState } from "./state.js"; import { ComparingView, - ErrorLoadingView, NoExchangesView, PrivacyContentView, ReadyView, @@ -38,7 +38,7 @@ import { export interface Props { list: ExchangeListItem[]; - currentExchange: string; + initialValue: string; onCancel: () => Promise<void>; onSelection: (exchange: string) => Promise<void>; } @@ -50,7 +50,7 @@ export type State = | State.Comparing | State.ShowingTos | State.ShowingPrivacy - | SelectExchangeState.NoExchange; + | SelectExchangeState.NoExchangeFound; export namespace State { export interface Loading { @@ -59,8 +59,8 @@ export namespace State { } export interface LoadingUriError { - status: "error-loading"; - error: HookError; + status: "error"; + error: ErrorAlert; } export interface BaseInfo { @@ -78,7 +78,11 @@ export namespace State { export interface Comparing extends BaseInfo { status: "comparing"; - pairTimeline: DenomOperationMap<FeeDescriptionPair[]>; + coinOperationTimeline: DenomOperationMap<FeeDescriptionPair[]>; + wireFeeTimeline: Record<string, FeeDescriptionPair[]>; + globalFeeTimeline: FeeDescriptionPair[]; + missingWireTYpe: string[]; + newWireType: string[]; onReset: ButtonHandler; onSelect: ButtonHandler; } @@ -96,9 +100,9 @@ export namespace State { const viewMapping: StateViewMap<State> = { loading: Loading, - "error-loading": ErrorLoadingView, + error: ErrorAlertView, comparing: ComparingView, - "no-exchange": NoExchangesView, + "no-exchange-found": NoExchangesView, "showing-tos": TosContentView, "showing-privacy": PrivacyContentView, ready: ReadyView, @@ -106,6 +110,6 @@ const viewMapping: StateViewMap<State> = { export const ExchangeSelectionPage = compose( "ExchangeSelectionPage", - (p: Props) => useComponentState(p, wxApi), + (p: Props) => useComponentState(p), viewMapping, ); |