Skip to content

Commit

Permalink
wip: reset after delete
Browse files Browse the repository at this point in the history
  • Loading branch information
alonkeyval committed Oct 20, 2024
1 parent 4a4abd4 commit d5b4f9b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ const OverviewDrawer = () => {
initialTitle();
};

const handleClose = () => {
setIsEditing(false);
setDrawerItem(null);
setIsDeleteModalOpen(false);
};

const handleDelete = async () => {
if (
selectedItem?.type === OVERVIEW_ENTITY_TYPES.SOURCE &&
Expand All @@ -135,19 +141,14 @@ const OverviewDrawer = () => {
selected: false,
},
]);
handleClose();
} catch (error) {
console.error('Error deleting source:', error);
}
}
setDrawerItem(null); // Close the drawer on delete
};

const handleClose = () => {
setIsEditing(false);
setDrawerItem(null);
setIsDeleteModalOpen(false);
};

const handleCloseDeleteModal = () => {
setIsDeleteModalOpen(false);
};
Expand Down

0 comments on commit d5b4f9b

Please sign in to comment.