taler-typescript-core

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

commit 10c4522160579ada77b11970e41b0951038dc621
parent 067264294d292efb092520013d4da73f14bea77f
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Mon, 20 Jul 2026 15:27:29 -0300

bank spa: override existing operation

Diffstat:
Mpackages/libeufin-bank-webui/src/pages/OperationState/state.ts | 6++++--
Mpackages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 31++++++++++++++++---------------
2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/packages/libeufin-bank-webui/src/pages/OperationState/state.ts b/packages/libeufin-bank-webui/src/pages/OperationState/state.ts @@ -82,9 +82,11 @@ export function useComponentState({ const withdrawalOperationId = bankState.currentWithdrawalOperationId; useEffect(() => { - if (withdrawalOperationId === undefined) { + // FIXME: should we tell the user about current operation? + // if (withdrawalOperationId === undefined) { + // override existing operation doSilentStart(); - } + // } }, [preference.fastWithdrawalForm, amount]); if (failure) { diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -49,7 +49,7 @@ export function useComponentStateFromParams({ const api = useBackendContext(); const { i18n } = useTranslationContext(); // const paramsAmount = amount ? Amounts.parse(amount) : undefined; - const [updatedExchangeByUser, setUpdatedExchangeByUser] = useState<string>(); + // const [updatedExchangeByUser, setUpdatedExchangeByUser] = useState<string>(); const uriInfoHook = useAsyncAsHook(async () => { const uri = maybeTalerUri ? Result.orUndefined( @@ -63,7 +63,8 @@ export function useComponentStateFromParams({ const exchangeUrlByScope = scope?.type === ScopeType.Exchange ? scope.url : undefined; const exchangeByScopeOrTalerUri = - updatedExchangeByUser ?? exchangeUrlByScope ?? uri?.exchangeBaseUrl; + // updatedExchangeByUser ?? exchangeUrlByScope ?? uri?.exchangeBaseUrl; + exchangeUrlByScope ?? uri?.exchangeBaseUrl; let ex: ExchangeFullDetails | undefined; if (exchangeByScopeOrTalerUri) { @@ -168,7 +169,7 @@ export function useComponentStateFromParams({ exchange: exchangeByUrl, exchangeList: exchangeList, }, - setUpdatedExchangeByUser, + // setUpdatedExchangeByUser, exchangeScope, ); } @@ -182,7 +183,7 @@ export function useComponentStateFromURI({ const { i18n } = useTranslationContext(); // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [updatedExchangeByUser, setUpdatedExchangeByUser] = useState<string>(); + // const [updatedExchangeByUser, setUpdatedExchangeByUser] = useState<string>(); /** * Ask the wallet about the withdraw URI */ @@ -331,7 +332,7 @@ export function useComponentStateFromURI({ exchange: bwi.defaultExchangeBaseUrl, exchangeList: bwi.possibleExchanges, }, - setUpdatedExchangeByUser, + // setUpdatedExchangeByUser, exchangeScope, ); }, []); @@ -360,7 +361,7 @@ function exchangeSelectionState( onSuccess: (txid: string) => Promise<void>, talerWithdrawUri: string | undefined, wInfo: WithdrawalInfo, - onExchangeUpdated: (ex: string) => void, + // onExchangeUpdated: (ex: string) => void, scope: ScopeInfo, ): RecursiveState<State> { const api = useBackendContext(); @@ -370,15 +371,15 @@ function exchangeSelectionState( list: wInfo.exchangeList, }); - const current = - selectedExchange.status !== "ready" - ? undefined - : selectedExchange.selected.exchangeBaseUrl; - useEffect(() => { - if (current) { - onExchangeUpdated(current); - } - }, [current]); + // const current = + // selectedExchange.status !== "ready" + // ? undefined + // : selectedExchange.selected.exchangeBaseUrl; + // useEffect(() => { + // if (current) { + // onExchangeUpdated(current); + // } + // }, [current]); const safeAmount = wInfo.amount ? wInfo.amount