mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Fleet UI: Persist toast messages after a modal closes (#17674)
This commit is contained in:
parent
f28509ea06
commit
b9c3d3a5b4
1
changes/17624-modal-flash-message-error
Normal file
1
changes/17624-modal-flash-message-error
Normal file
@ -0,0 +1 @@
|
||||
* Fix flash message from closing when a modal closes
|
@ -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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user