taler-typescript-core

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

commit b448b77eb4e8dc0157d1780e11bc0f38d7b636cf
parent 0726a39a6ae1064d59c316547fab5c39df62460b
Author: Florian Dold <florian@dold.me>
Date:   Tue, 12 Dec 2023 16:47:26 +0100

-work around multiple available languages

Diffstat:
Mpackages/taler-wallet-core/src/operations/exchanges.ts | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -152,7 +152,11 @@ async function downloadExchangeWithTermsOfService( const tosContentLanguage = resp.headers.get("content-language") || undefined; const tosContentType = resp.headers.get("content-type") || "text/plain"; const availLangStr = resp.headers.get("avail-languages") || ""; - const tosAvailableLanguages = availLangStr.split(",").map((x) => x.trim()); + // Work around exchange bug that reports the same language multiple times. + const availLangSet = new Set<string>( + availLangStr.split(",").map((x) => x.trim()), + ); + const tosAvailableLanguages = [...availLangSet]; return { tosText,