Fixed bug on delete widget modal (#13945)

This commit is contained in:
Aniket Katkar 2023-11-10 23:51:37 +05:30 committed by GitHub
parent 2f4d3fe9eb
commit 1e3d7f812e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,11 +109,14 @@ const DeleteWidgetModal = ({
}, []);
const handleOnEntityDeleteCancel = useCallback(() => {
setEntityDeleteState(ENTITY_DELETE_STATE);
setEntityDeleteState({
...ENTITY_DELETE_STATE,
softDelete: allowSoftDelete,
});
setName('');
setValue(allowSoftDelete ? DeleteType.SOFT_DELETE : DeleteType.HARD_DELETE);
onCancel();
}, [onCancel]);
}, [onCancel, allowSoftDelete]);
const handleOnEntityDeleteConfirm = useCallback(async () => {
try {