From 15437f3652f004e579a5281c3c2059b905f42ca3 Mon Sep 17 00:00:00 2001 From: Abhinav-grd Date: Mon, 19 Apr 2021 15:42:16 +0530 Subject: [PATCH] wait for callback to finish before closing --- src/components/ConfirmDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ConfirmDialog.tsx b/src/components/ConfirmDialog.tsx index 137ec9665..4488e4184 100644 --- a/src/components/ConfirmDialog.tsx +++ b/src/components/ConfirmDialog.tsx @@ -46,8 +46,8 @@ function ConfirmDialog({ callback, action, ...props }: Props) { ], proceed: { text: constants[CONFIRM_ACTION_VALUES[action]?.text], - action: () => { - callback(); + action: async () => { + await callback(); props.onHide(); }, variant: CONFIRM_ACTION_VALUES[action]?.type,