fix(dialog,web) fix opening dialogs in succession

If onSubmit opens a new dialog, we'd be hiding it otherwise.
This commit is contained in:
Saúl Ibarra Corretgé 2022-10-27 17:13:11 +02:00 committed by Saúl Ibarra Corretgé
parent 69f4b116a9
commit eb59949dfa
1 changed files with 2 additions and 2 deletions

View File

@ -228,13 +228,13 @@ const Dialog = ({
const dispatch = useDispatch();
const onClose = useCallback(() => {
onCancel?.();
dispatch(hideDialog());
onCancel?.();
}, [ onCancel ]);
const submit = useCallback(() => {
onSubmit?.();
dispatch(hideDialog());
onSubmit?.();
}, [ onSubmit ]);
const handleKeyDown = useCallback((e: KeyboardEvent) => {