diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-05 12:06:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-05 12:06:24 -0300 |
commit | 8eee38d55936c194637ecead302dde69ec0b9897 (patch) | |
tree | fc87a818fa586152e5f6ad1dfb29e917abe959f7 /packages/taler-wallet-webextension/src/cta/Withdraw | |
parent | d5c5c7463e5210916822c8030bb59c7b0f3ccc1c (diff) | |
download | wallet-core-8eee38d55936c194637ecead302dde69ec0b9897.tar.xz |
fix #7791
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw')
3 files changed, 7 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts index 7dfc7c141..45c37ba5c 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts @@ -46,7 +46,7 @@ export interface PropsFromParams { export type State = | State.Loading | State.LoadingUriError - | SelectExchangeState.NoExchange + | SelectExchangeState.NoExchangeFound | SelectExchangeState.Selecting | State.Success; @@ -84,7 +84,7 @@ export namespace State { const viewMapping: StateViewMap<State> = { loading: Loading, error: ErrorAlertView, - "no-exchange": NoExchangesView, + "no-exchange-found": NoExchangesView, "selecting-exchange": ExchangeSelectionPage, success: SuccessView, }; diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 9522c2bfb..4de026190 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -118,12 +118,12 @@ export function useComponentStateFromURI({ talerWithdrawUri, }, ); - const { amount, defaultExchangeBaseUrl } = uriInfo; + const { amount, defaultExchangeBaseUrl, possibleExchanges } = uriInfo; return { talerWithdrawUri, amount: Amounts.parseOrThrow(amount), thisExchange: defaultExchangeBaseUrl, - exchanges: uriInfo.possibleExchanges, + exchanges: possibleExchanges, }; }); @@ -191,12 +191,12 @@ function exchangeSelectionState( talerWithdrawUri: string | undefined, chosenAmount: AmountJson, exchangeList: ExchangeListItem[], - defaultExchange: string | undefined, + exchangeSuggestedByTheBank: string | undefined, ): RecursiveState<State> { const api = useBackendContext(); const selectedExchange = useSelectedExchange({ currency: chosenAmount.currency, - defaultExchange, + defaultExchange: exchangeSuggestedByTheBank, list: exchangeList, }); diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index 5a6200844..d90fc72ac 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -122,7 +122,7 @@ describe("Withdraw CTA states", () => { expect(status).equals("loading"); }, ({ status, error }) => { - expect(status).equals("no-exchange"); + expect(status).equals("no-exchange-found"); expect(error).undefined; }, ], |