From f93bd51499ed34844b666bf6d333227adf4368bf Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 15 Dec 2022 17:11:24 -0300
Subject: wxApi from context and using the new testing sdk

---
 .../src/wallet/ProviderDetailPage.tsx                        | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx
index 6dde30b39..46d54e871 100644
--- a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx
@@ -28,10 +28,10 @@ import { Loading } from "../components/Loading.js";
 import { LoadingError } from "../components/LoadingError.js";
 import { PaymentStatus, SmallLightText } from "../components/styled/index.js";
 import { Time } from "../components/Time.js";
+import { useBackendContext } from "../context/backend.js";
 import { useTranslationContext } from "../context/translation.js";
 import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js";
 import { Button } from "../mui/Button.js";
-import { wxApi } from "../wxApi.js";
 
 interface Props {
   pid: string;
@@ -47,12 +47,10 @@ export function ProviderDetailPage({
   onWithdraw,
 }: Props): VNode {
   const { i18n } = useTranslationContext();
+  const api = useBackendContext();
   async function getProviderInfo(): Promise<ProviderInfo | null> {
     //create a first list of backup info by currency
-    const status = await wxApi.wallet.call(
-      WalletApiOperation.GetBackupInfo,
-      {},
-    );
+    const status = await api.wallet.call(WalletApiOperation.GetBackupInfo, {});
 
     const providers = status.providers.filter(
       (p) => p.syncProviderBaseUrl === providerURL,
@@ -103,7 +101,7 @@ export function ProviderDetailPage({
     <ProviderView
       info={info}
       onSync={async () =>
-        wxApi.wallet
+        api.wallet
           .call(WalletApiOperation.RunBackupCycle, {
             providers: [providerURL],
           })
@@ -120,7 +118,7 @@ export function ProviderDetailPage({
         onWithdraw(info.paymentStatus.amount);
       }}
       onDelete={() =>
-        wxApi.wallet
+        api.wallet
           .call(WalletApiOperation.RemoveBackupProvider, {
             provider: providerURL,
           })
-- 
cgit v1.2.3

