diff options
author | Sebastian <sebasjm@gmail.com> | 2022-04-11 18:00:28 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-04-11 18:00:28 -0300 |
commit | d34eeb5c8c90c7143922b303cf3a7dbc2357246c (patch) | |
tree | b2a04135dec4f01dec21c03e62dee61e5c0ade7c /packages/taler-wallet-webextension/src/hooks | |
parent | 1ae4a44a3a835cbf19ae4e885f0ca97eb10279b3 (diff) | |
download | wallet-core-d34eeb5c8c90c7143922b303cf3a7dbc2357246c.tar.xz |
using the test to fine tune the withdraw process
Diffstat (limited to 'packages/taler-wallet-webextension/src/hooks')
-rw-r--r-- | packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts index 51123d154..e592073dd 100644 --- a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts +++ b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts @@ -42,7 +42,7 @@ export interface HookOperationalError { export type HookResponse<T> = HookOk<T> | HookError | undefined; export function useAsyncAsHook<T>( - fn: () => Promise<T>, + fn: () => Promise<T | false>, updateOnNotification?: Array<NotificationType>, deps?: any[], ): HookResponse<T> { @@ -57,6 +57,7 @@ export function useAsyncAsHook<T>( async function doAsync(): Promise<void> { try { const response = await args.fn(); + if (response === false) return; setHookResponse({ hasError: false, response }); } catch (e) { if (e instanceof TalerError) { |