diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-20 20:26:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-20 20:26:47 -0300 |
commit | 859991a40c4a7757d874f9ae6e6db7b76145a3c3 (patch) | |
tree | 2d029521929fa63f731e0b62bd3342f6f70ad2f8 /packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | |
parent | 7adaeff0a57bc2d0633dd6a2c750a91facc03c4d (diff) | |
download | wallet-core-859991a40c4a7757d874f9ae6e6db7b76145a3c3.tar.xz |
exchange selection for invoices and some fixes
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 2e68d056e..5b5c11182 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -36,8 +36,6 @@ export function useComponentStateFromParams( return { amount: Amounts.parseOrThrow(amount), exchanges }; }); - console.log("uri info", uriInfoHook) - if (!uriInfoHook) return { status: "loading", error: undefined }; if (uriInfoHook.hasError) { @@ -80,7 +78,6 @@ export function useComponentStateFromURI( return { talerWithdrawUri, amount: Amounts.parseOrThrow(amount), thisExchange: defaultExchangeBaseUrl, exchanges }; }); - console.log("uri info", uriInfoHook) if (!uriInfoHook) return { status: "loading", error: undefined }; if (uriInfoHook.hasError) { @@ -111,20 +108,11 @@ type ManualOrManagedWithdrawFunction = (exchange: string, ageRestricted: number function exchangeSelectionState(doWithdraw: ManualOrManagedWithdrawFunction, cancel: () => Promise<void>, onSuccess: (txid: string) => Promise<void>, talerWithdrawUri: string | undefined, chosenAmount: AmountJson, exchangeList: ExchangeListItem[], defaultExchange: string | undefined, api: typeof wxApi,): RecursiveState<State> { - //FIXME: use substates here const selectedExchange = useSelectedExchange({ currency: chosenAmount.currency, defaultExchange, list: exchangeList }) - if (selectedExchange.status === 'no-exchange') { - return { - status: "no-exchange", - error: undefined, - } - } - - if (selectedExchange.status === 'selecting-exchange') { + if (selectedExchange.status !== 'ready') { return selectedExchange } - console.log("exchange selected", selectedExchange.selected) return () => { @@ -142,7 +130,7 @@ function exchangeSelectionState(doWithdraw: ManualOrManagedWithdrawFunction, can return { state }; }, []); - console.log("terms", terms) + /** * With the exchange and amount, ask the wallet the information * about the withdrawal |