Skip to content

Commit

Permalink
fix(U250): fix rimozione dati dopo cancellazione ricerca 20250114
Browse files Browse the repository at this point in the history
  • Loading branch information
federico-tocci-dxc authored and lcucuzzella committed Jan 14, 2025
1 parent df5d6f2 commit 32c857d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ const ManageFacilitator: React.FC<ManageFacilitatorI> = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [creation, open]);

const resetModal = (toClose = true) => {
clearForm();
setShowForm(false);
setAlreadySearched(false);
setIsUserSelected(false);
setFirstOpen(true);
dispatch(setUsersList(null));
if (toClose) dispatch(closeModal());
};

useEffect(() => {
if (usersList && usersList.length === 0) {
setNoResult(true);
Expand Down Expand Up @@ -232,6 +242,7 @@ const ManageFacilitator: React.FC<ManageFacilitatorI> = ({
dispatch(setUsersList(null));
dispatch(resetUserDetails());
setCanSubmit(false);
resetModal(false);
}}
title=''
search
Expand Down

0 comments on commit 32c857d

Please sign in to comment.