diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
commit | f93bd51499ed34844b666bf6d333227adf4368bf (patch) | |
tree | ed3cf0c38b7db54276436d1743a6085c94f71977 /packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx | |
parent | 8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff) | |
download | wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.gz wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.bz2 wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.zip |
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx index a0c62787a..d8a7c6090 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx @@ -21,9 +21,9 @@ import { import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; +import { useBackendContext } from "../context/backend.js"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { queryToSlashKeys } from "../utils/index.js"; -import { wxApi } from "../wxApi.js"; import { ExchangeAddConfirmPage } from "./ExchangeAddConfirm.js"; import { ExchangeSetUrlPage } from "./ExchangeSetUrl.js"; @@ -37,8 +37,9 @@ export function ExchangeAddPage({ currency, onBack }: Props): VNode { { url: string; config: TalerConfigResponse } | undefined >(undefined); + const api = useBackendContext(); const knownExchangesResponse = useAsyncAsHook(() => - wxApi.wallet.call(WalletApiOperation.ListExchanges, {}), + api.wallet.call(WalletApiOperation.ListExchanges, {}), ); const knownExchanges = !knownExchangesResponse ? [] @@ -75,7 +76,7 @@ export function ExchangeAddPage({ currency, onBack }: Props): VNode { url={verifying.url} onCancel={onBack} onConfirm={async () => { - await wxApi.wallet.call(WalletApiOperation.AddExchange, { + await api.wallet.call(WalletApiOperation.AddExchange, { exchangeBaseUrl: canonicalizeBaseUrl(verifying.url), forceUpdate: true, }); |