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

---
 packages/taler-wallet-webextension/src/wallet/BackupPage.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
index c9dbfb64d..6e987f965 100644
--- a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx
@@ -42,11 +42,11 @@ import {
   SmallText,
   WarningBox,
 } from "../components/styled/index.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 { Pages } from "../NavigationBar.js";
-import { wxApi } from "../wxApi.js";
 
 interface Props {
   onAddProvider: () => Promise<void>;
@@ -107,8 +107,9 @@ export function ShowRecoveryInfo({
 
 export function BackupPage({ onAddProvider }: Props): VNode {
   const { i18n } = useTranslationContext();
+  const api = useBackendContext();
   const status = useAsyncAsHook(() =>
-    wxApi.wallet.call(WalletApiOperation.GetBackupInfo, {}),
+    api.wallet.call(WalletApiOperation.GetBackupInfo, {}),
   );
   const [recoveryInfo, setRecoveryInfo] = useState<string>("");
   if (!status) {
@@ -124,7 +125,7 @@ export function BackupPage({ onAddProvider }: Props): VNode {
   }
 
   async function getRecoveryInfo(): Promise<void> {
-    const r = await wxApi.wallet.call(
+    const r = await api.wallet.call(
       WalletApiOperation.ExportBackupRecovery,
       {},
     );
@@ -158,7 +159,7 @@ export function BackupPage({ onAddProvider }: Props): VNode {
       providers={providers}
       onAddProvider={onAddProvider}
       onSyncAll={async () =>
-        wxApi.wallet.call(WalletApiOperation.RunBackupCycle, {}).then()
+        api.wallet.call(WalletApiOperation.RunBackupCycle, {}).then()
       }
       onShowInfo={getRecoveryInfo}
     />
-- 
cgit v1.2.3

