From 1e3d7f812e736bc534a15197da46eae492f4c842 Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Fri, 10 Nov 2023 23:51:37 +0530 Subject: [PATCH] Fixed bug on delete widget modal (#13945) --- .../components/common/DeleteWidget/DeleteWidgetModal.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx index 92f7e56912a..836285d8758 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx @@ -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 {