diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/OperationState/state.ts')
-rw-r--r-- | packages/demobank-ui/src/pages/OperationState/state.ts | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/packages/demobank-ui/src/pages/OperationState/state.ts b/packages/demobank-ui/src/pages/OperationState/state.ts index c9c1fa238..9e34a846b 100644 --- a/packages/demobank-ui/src/pages/OperationState/state.ts +++ b/packages/demobank-ui/src/pages/OperationState/state.ts @@ -86,10 +86,10 @@ export function useComponentState({ currency, onClose }: Props): utils.Recursive const wid = withdrawalOperationId async function doAbort() { - setBusy({}) await withRuntimeErrorHandling(i18n, async () => { const resp = await api.abortWithdrawalById(wid); if (resp.type === "ok") { + updateSettings("currentWithdrawalOperationId", undefined) onClose(); } else { switch (resp.case) { @@ -103,7 +103,6 @@ export function useComponentState({ currency, onClose }: Props): utils.Recursive } } }) - setBusy(undefined) } async function doConfirm() { @@ -220,11 +219,7 @@ export function useComponentState({ currency, onClose }: Props): utils.Recursive status: "ready", error: undefined, uri: parsedUri, - onClose: async () => { - await doAbort() - updateSettings("currentWithdrawalOperationId", undefined) - onClose() - }, + onClose: doAbort, onAbort: doAbort, } } @@ -252,11 +247,7 @@ export function useComponentState({ currency, onClose }: Props): utils.Recursive return { status: "need-confirmation", error: undefined, - onAbort: async () => { - await doAbort() - updateSettings("currentWithdrawalOperationId", undefined) - onClose() - }, + onAbort: doAbort, busy: !!busy, onConfirm: doConfirm } |