mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Restore intended flash messages (#23152)
Addresses #23139 and #23141 - Remove a premature `return` that prevented subsequent `renderFlash` from firing - Fix order of `push` and subsequent `renderFlash` for correct behavior - Check codebase for additional instances of problematic `push` calls _after_ associated `renderFlash` calls via regex `\renderFlash\([\s\S\n]{0,400}router\.push/` - Misc cleanup  - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
fe9ccd23c6
commit
de7c792945
3 changed files with 3 additions and 4 deletions
|
|
@ -295,12 +295,11 @@ const TeamDetailsWrapper = ({
|
|||
|
||||
try {
|
||||
await teamsAPI.destroy(teamIdForApi);
|
||||
return router.push(PATHS.ADMIN_TEAMS);
|
||||
router.push(PATHS.ADMIN_TEAMS);
|
||||
renderFlash("success", "Team removed");
|
||||
} catch (response) {
|
||||
renderFlash("error", "Something went wrong removing the team");
|
||||
console.error(response);
|
||||
return false;
|
||||
} finally {
|
||||
toggleDeleteTeamModal();
|
||||
setIsUpdatingTeams(false);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const DeleteTeamModal = ({
|
|||
}: IDeleteTeamModalProps): JSX.Element => {
|
||||
return (
|
||||
<Modal
|
||||
title={"Delete team"}
|
||||
title="Delete team"
|
||||
onExit={onCancel}
|
||||
onEnter={onSubmit}
|
||||
className={baseClass}
|
||||
|
|
|
|||
|
|
@ -547,11 +547,11 @@ const HostDetailsPage = ({
|
|||
setIsUpdatingHost(true);
|
||||
try {
|
||||
await hostAPI.destroy(host);
|
||||
router.push(PATHS.MANAGE_HOSTS);
|
||||
renderFlash(
|
||||
"success",
|
||||
`Host "${host.display_name}" was successfully deleted.`
|
||||
);
|
||||
router.push(PATHS.MANAGE_HOSTS);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
renderFlash(
|
||||
|
|
|
|||
Loading…
Reference in a new issue