Fleet UI: Persist toast messages after a modal closes (#17674)

This commit is contained in:
RachelElysia 2024-03-18 14:53:30 -04:00 committed by GitHub
parent f28509ea06
commit b9c3d3a5b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -0,0 +1 @@
* Fix flash message from closing when a modal closes

View File

@ -1,6 +1,5 @@
import React, { useContext, useEffect } from "react";
import React, { useEffect } from "react";
import classnames from "classnames";
import { NotificationContext } from "context/notification";
import Button from "components/buttons/Button/Button";
import Icon from "components/Icon/Icon";
@ -32,8 +31,6 @@ const Modal = ({
isLoading = false,
className,
}: IModalProps): JSX.Element => {
const { hideFlash } = useContext(NotificationContext);
useEffect(() => {
const closeWithEscapeKey = (e: KeyboardEvent) => {
if (e.key === "Escape") {
@ -41,7 +38,6 @@ const Modal = ({
}
};
hideFlash();
document.addEventListener("keydown", closeWithEscapeKey);
return () => {