taler-typescript-core

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

commit 09e4c287605fd3d8d8762d817e4ecc467bdd0207
parent dfb2e8735a84f00ca5d6b3b79833a78d0293606e
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 24 Sep 2025 11:47:49 -0300

fix broken build;

Diffstat:
Mpackages/taler-wallet-webextension/src/wallet/AddExchange/state.ts | 14++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/state.ts b/packages/taler-wallet-webextension/src/wallet/AddExchange/state.ts @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { ExchangeEntryStatus, TalerExchangeHttpClient, canonicalizeBaseUrl, opKnownFailure, opKnownFailureWithBody } from "@gnu-taler/taler-util"; +import { ExchangeEntryStatus, TalerExchangeHttpClient, canonicalizeBaseUrl, opKnownFailure, opKnownFailureWithBody, succeedOrThrow } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { BrowserFetchHttpLib } from "@gnu-taler/web-util/browser"; import { useCallback, useEffect, useState } from "preact/hooks"; @@ -84,15 +84,9 @@ export function useComponentState({ onBack, currency, noDebounce }: Props): Recu const api = new TalerExchangeHttpClient(baseUrl.href, { httpClient: new BrowserFetchHttpLib(), }); - const config = await api.getConfig() - if (config.type === "fail") { - return opKnownFailure("not-found" as const) - } - if (!api.isCompatible(config.body.version)) { - return opKnownFailureWithBody("invalid-version"as const, config.body.version) - } - if (currency !== undefined && currency !== config.body.currency) { - return opKnownFailureWithBody("invalid-currency"as const, config.body.currency) + const config = succeedOrThrow(await api.getConfig()) + if (currency !== undefined && currency !== config.currency) { + return opKnownFailureWithBody("invalid-currency"as const, config.currency) } const keys = await api.getKeys() return keys