diff options
author | Florian Dold <florian@dold.me> | 2023-12-12 16:47:26 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-12-12 16:47:26 +0100 |
commit | b448b77eb4e8dc0157d1780e11bc0f38d7b636cf (patch) | |
tree | c039880e97895734d59e0605d5cb07a7c868ae09 /packages/taler-wallet-core | |
parent | 0726a39a6ae1064d59c316547fab5c39df62460b (diff) | |
download | wallet-core-b448b77eb4e8dc0157d1780e11bc0f38d7b636cf.tar.xz |
-work around multiple available languages
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/operations/exchanges.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index 88127b71f..69f708364 100644 --- 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, |