aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/hooks
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-04-11 18:00:28 -0300
committerSebastian <sebasjm@gmail.com>2022-04-11 18:00:28 -0300
commitd34eeb5c8c90c7143922b303cf3a7dbc2357246c (patch)
treeb2a04135dec4f01dec21c03e62dee61e5c0ade7c /packages/taler-wallet-webextension/src/hooks
parent1ae4a44a3a835cbf19ae4e885f0ca97eb10279b3 (diff)
downloadwallet-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.ts3
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) {