taler-typescript-core

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

commit 65f168b4d259603cb9321f19228507875da87038
parent 1e2d09017fd5bd0a8b5def8a30f5a7c07e8a7156
Author: Florian Dold <florian@dold.me>
Date:   Sun, 16 Jun 2024 17:47:29 +0200

wallet-core: fix return value of getExchangeTos for missing ToS

Diffstat:
Mpackages/taler-wallet-core/src/exchanges.ts | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts @@ -2122,6 +2122,19 @@ export async function getExchangeTos( ): Promise<GetExchangeTosResult> { const exch = await fetchFreshExchange(wex, exchangeBaseUrl); + switch (exch.tosStatus) { + case ExchangeTosStatus.MissingTos: + return { + tosStatus: ExchangeTosStatus.MissingTos, + acceptedEtag: undefined, + contentLanguage: undefined, + contentType: "text/plain", + content: "NULL", + currentEtag: "NULL", + tosAvailableLanguages: [], + }; + } + const tosDownload = await downloadTosFromAcceptedFormat( wex, exchangeBaseUrl,