diff options
author | Sebastian <sebasjm@gmail.com> | 2022-11-16 16:04:52 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-11-16 16:05:13 -0300 |
commit | 1a63d56bfdd091cc7aefdf1e25f3a074bfdf5e0e (patch) | |
tree | 7255cf4a5b51af4807e2a01a370497413a78968f /packages/taler-wallet-webextension/src/hooks | |
parent | 53164dc47b1138235a0c797affaa6fb37ea43239 (diff) | |
download | wallet-core-1a63d56bfdd091cc7aefdf1e25f3a074bfdf5e0e.tar.xz |
fix #7411, also making the backup payment visible
Diffstat (limited to 'packages/taler-wallet-webextension/src/hooks')
5 files changed, 23 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/hooks/useAutoOpenPermissions.ts b/packages/taler-wallet-webextension/src/hooks/useAutoOpenPermissions.ts index 5a0194db8..3361394a4 100644 --- a/packages/taler-wallet-webextension/src/hooks/useAutoOpenPermissions.ts +++ b/packages/taler-wallet-webextension/src/hooks/useAutoOpenPermissions.ts @@ -63,7 +63,9 @@ async function handleAutoOpenPerm( onChange(res.newValue); } else { try { - await wxApi.background.toggleHeaderListener(false).then((r) => onChange(r.newValue)); + await wxApi.background + .toggleHeaderListener(false) + .then((r) => onChange(r.newValue)); } catch (e) { console.log(e); } diff --git a/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts b/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts index 7339a876a..be81b7d7d 100644 --- a/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts +++ b/packages/taler-wallet-webextension/src/hooks/useBackupDeviceName.ts @@ -32,10 +32,15 @@ export function useBackupDeviceName(): BackupDeviceName { useEffect(() => { async function run(): Promise<void> { //create a first list of backup info by currency - const status = await wxApi.wallet.call(WalletApiOperation.GetBackupInfo, {}); + const status = await wxApi.wallet.call( + WalletApiOperation.GetBackupInfo, + {}, + ); async function update(newName: string): Promise<void> { - await wxApi.wallet.call(WalletApiOperation.SetWalletDeviceId, { walletDeviceId: newName }); + await wxApi.wallet.call(WalletApiOperation.SetWalletDeviceId, { + walletDeviceId: newName, + }); setStatus((old) => ({ ...old, name: newName })); } diff --git a/packages/taler-wallet-webextension/src/hooks/useClipboardPermissions.ts b/packages/taler-wallet-webextension/src/hooks/useClipboardPermissions.ts index 3d284fb5a..9b7d46ba7 100644 --- a/packages/taler-wallet-webextension/src/hooks/useClipboardPermissions.ts +++ b/packages/taler-wallet-webextension/src/hooks/useClipboardPermissions.ts @@ -66,7 +66,9 @@ async function handleClipboardPerm( onChange(granted); } else { try { - await wxApi.background.toggleHeaderListener(false).then((r) => onChange(r.newValue)); + await wxApi.background + .toggleHeaderListener(false) + .then((r) => onChange(r.newValue)); } catch (e) { console.log(e); } diff --git a/packages/taler-wallet-webextension/src/hooks/useProviderStatus.ts b/packages/taler-wallet-webextension/src/hooks/useProviderStatus.ts index b73c9fc16..e6473d1ec 100644 --- a/packages/taler-wallet-webextension/src/hooks/useProviderStatus.ts +++ b/packages/taler-wallet-webextension/src/hooks/useProviderStatus.ts @@ -30,7 +30,10 @@ export function useProviderStatus(url: string): ProviderStatus | undefined { useEffect(() => { async function run(): Promise<void> { //create a first list of backup info by currency - const status = await wxApi.wallet.call(WalletApiOperation.GetBackupInfo, {}); + const status = await wxApi.wallet.call( + WalletApiOperation.GetBackupInfo, + {}, + ); const providers = status.providers.filter( (p) => p.syncProviderBaseUrl === url, @@ -40,7 +43,7 @@ export function useProviderStatus(url: string): ProviderStatus | undefined { async function sync(): Promise<void> { if (info) { await wxApi.wallet.call(WalletApiOperation.RunBackupCycle, { - providers: [info.syncProviderBaseUrl] + providers: [info.syncProviderBaseUrl], }); } } @@ -48,7 +51,7 @@ export function useProviderStatus(url: string): ProviderStatus | undefined { async function remove(): Promise<void> { if (info) { await wxApi.wallet.call(WalletApiOperation.RemoveBackupProvider, { - provider: info.syncProviderBaseUrl + provider: info.syncProviderBaseUrl, }); } } diff --git a/packages/taler-wallet-webextension/src/hooks/useWalletDevMode.ts b/packages/taler-wallet-webextension/src/hooks/useWalletDevMode.ts index 8d4921392..d5743eb2e 100644 --- a/packages/taler-wallet-webextension/src/hooks/useWalletDevMode.ts +++ b/packages/taler-wallet-webextension/src/hooks/useWalletDevMode.ts @@ -48,8 +48,10 @@ async function handleOpen( currentValue: undefined | boolean, onChange: (value: boolean) => void, ): Promise<void> { - const nextValue = !currentValue - await wxApi.wallet.call(WalletApiOperation.SetDevMode, { devModeEnabled: nextValue }); + const nextValue = !currentValue; + await wxApi.wallet.call(WalletApiOperation.SetDevMode, { + devModeEnabled: nextValue, + }); onChange(nextValue); return; } |