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/BackupPage.tsx | |
parent | 8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff) | |
download | wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.xz |
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/BackupPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/BackupPage.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
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} /> |