diff --git a/frontend/src/components/common/DeleteModal.tsx b/frontend/src/components/common/DeleteModal.tsx index a87fc934..a60ca3cc 100644 --- a/frontend/src/components/common/DeleteModal.tsx +++ b/frontend/src/components/common/DeleteModal.tsx @@ -50,7 +50,13 @@ const DeleteModal = ({ - diff --git a/frontend/src/components/pages/AccessControl/index.tsx b/frontend/src/components/pages/AccessControl/index.tsx index 74609174..7ca9ecab 100644 --- a/frontend/src/components/pages/AccessControl/index.tsx +++ b/frontend/src/components/pages/AccessControl/index.tsx @@ -182,7 +182,6 @@ const AccessControlPage = (): JSX.Element => { duration: 3000, }); } - onClose(); setUserToChangeStatus(null); }; @@ -217,9 +216,13 @@ const AccessControlPage = (): JSX.Element => { buttonColor={userToChangeStatus?.active ? "red" : "green"} isOpen={isOpen} onClose={onClose} - onChangeStatus={() => - userToChangeStatus && handleStatusChange(userToChangeStatus) - } + onChangeStatus={() => { + if (userToChangeStatus) { + handleStatusChange(userToChangeStatus); + } + + onClose(); + }} /> FON Staff Access Control diff --git a/frontend/src/components/pages/CampOverview/CampersTable/WaitlistedCampersTable.tsx b/frontend/src/components/pages/CampOverview/CampersTable/WaitlistedCampersTable.tsx index e4aefbff..258f89cd 100644 --- a/frontend/src/components/pages/CampOverview/CampersTable/WaitlistedCampersTable.tsx +++ b/frontend/src/components/pages/CampOverview/CampersTable/WaitlistedCampersTable.tsx @@ -108,7 +108,6 @@ const WaitlistedCampersTable = ({ waitlistedCamper.id, ); - onClose(); if (deletedWaitlistedCamperResponse) { toast({ description: `${camperToDeleteName} has been removed from the waitlist for this camp session.`, diff --git a/frontend/src/components/pages/CampsList/index.tsx b/frontend/src/components/pages/CampsList/index.tsx index cf081f74..69a796d5 100644 --- a/frontend/src/components/pages/CampsList/index.tsx +++ b/frontend/src/components/pages/CampsList/index.tsx @@ -71,7 +71,6 @@ const CampsListPage = (): React.ReactElement => { duration: 3000, }); } - onDeleteModalClose(); setCampToDelete(null); }; @@ -89,7 +88,7 @@ const CampsListPage = (): React.ReactElement => { buttonLabel="Remove" isOpen={isDeleteModalOpen} onClose={onDeleteModalClose} - onDelete={() => handleConfirmDelete()} + onDelete={handleConfirmDelete} />