taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 2918dac1d807de7e034b0ee9ca8b512959a08b07
parent 10c4522160579ada77b11970e41b0951038dc621
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Mon, 20 Jul 2026 15:42:57 -0300

fix #11661

Diffstat:
Mpackages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 36++++++++++--------------------------
1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -129,10 +129,7 @@ export function useComponentStateFromParams({ exchange: string, ageRestricted: number | undefined, amount: AmountString, - ): Promise<{ - transactionId: string; - confirmTransferUrl: string | undefined; - }> { + ): Promise<{ transactionId: string }> { const res = await api.wallet.call( WalletApiOperation.AcceptManualWithdrawal, { @@ -142,7 +139,6 @@ export function useComponentStateFromParams({ }, ); return { - confirmTransferUrl: undefined, transactionId: res.transactionId, }; } @@ -169,8 +165,8 @@ export function useComponentStateFromParams({ exchange: exchangeByUrl, exchangeList: exchangeList, }, - // setUpdatedExchangeByUser, exchangeScope, + undefined, ); } @@ -270,19 +266,15 @@ export function useComponentStateFromURI({ exchange: string, ageRestricted: number | undefined, amount: AmountString, - ): Promise<{ - transactionId: string; - confirmTransferUrl: string | undefined; - }> { - const res = await api.wallet.call(WalletApiOperation.ConfirmWithdrawal, { + ): Promise<{ transactionId: string }> { + await api.wallet.call(WalletApiOperation.ConfirmWithdrawal, { exchangeBaseUrl: exchange, amount, restrictAge: ageRestricted, transactionId: txId, }); return { - confirmTransferUrl: res.confirmTransferUrl, - transactionId: res.transactionId, + transactionId: txId, }; } @@ -334,6 +326,7 @@ export function useComponentStateFromURI({ }, // setUpdatedExchangeByUser, exchangeScope, + bwi.confirmTransferUrl, ); }, []); } @@ -353,7 +346,7 @@ type ManualOrManagedWithdrawFunction = ( exchange: string, ageRestricted: number | undefined, amount: AmountString, -) => Promise<{ transactionId: string; confirmTransferUrl: string | undefined }>; +) => Promise<{ transactionId: string }>; function exchangeSelectionState( doWithdraw: ManualOrManagedWithdrawFunction, @@ -363,6 +356,7 @@ function exchangeSelectionState( wInfo: WithdrawalInfo, // onExchangeUpdated: (ex: string) => void, scope: ScopeInfo, + confirmUrl: string | undefined, ): RecursiveState<State> { const api = useBackendContext(); const selectedExchange = useSelectedExchange({ @@ -371,16 +365,6 @@ function exchangeSelectionState( list: wInfo.exchangeList, }); - // const current = - // selectedExchange.status !== "ready" - // ? undefined - // : selectedExchange.selected.exchangeBaseUrl; - // useEffect(() => { - // if (current) { - // onExchangeUpdated(current); - // } - // }, [current]); - const safeAmount = wInfo.amount ? wInfo.amount : Amounts.zeroOfCurrency(wInfo.currency); @@ -458,8 +442,8 @@ function exchangeSelectionState( !ageRestricted ? undefined : ageRestricted, Amounts.stringify(choosenAmount), ); - if (res.confirmTransferUrl) { - document.location.href = res.confirmTransferUrl; + if (confirmUrl) { + document.location.href = confirmUrl; } else { onSuccess(res.transactionId); }