diff options
author | Sebastian <sebasjm@gmail.com> | 2022-10-25 12:23:08 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-10-25 12:23:52 -0300 |
commit | 3f2db7707fdf4eb4c1dfdb527d5726dd1694e126 (patch) | |
tree | 4366d443db56eb200ba29760bf1f4a0b9def6c97 /packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts | |
parent | 587674dd10bd714b68ff5a6e836eb21113c0337a (diff) | |
download | wallet-core-3f2db7707fdf4eb4c1dfdb527d5726dd1694e126.tar.xz |
using new wallet api (typed interface)
Diffstat (limited to 'packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts b/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts index da3b05df4..7339a876a 100644 --- a/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts +++ b/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts @@ -14,8 +14,9 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useEffect, useState } from "preact/hooks"; -import * as wxApi from "../wxApi.js"; +import { wxApi } from "../wxApi.js"; export interface BackupDeviceName { name: string; @@ -31,10 +32,10 @@ export function useBackupDeviceName(): BackupDeviceName { useEffect(() => { async function run(): Promise<void> { //create a first list of backup info by currency - const status = await wxApi.getBackupInfo(); + const status = await wxApi.wallet.call(WalletApiOperation.GetBackupInfo, {}); async function update(newName: string): Promise<void> { - await wxApi.setWalletDeviceId(newName); + await wxApi.wallet.call(WalletApiOperation.SetWalletDeviceId, { walletDeviceId: newName }); setStatus((old) => ({ ...old, name: newName })); } |