refactor: removed escape keydown listener (#1814)

This commit is contained in:
Dakshesh Jain 2023-08-09 15:18:26 +05:30 committed by GitHub
parent 4fcd081d27
commit 1991e09035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,19 +125,6 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
setActiveProject(projects?.find((p) => p.id === projectId)?.id ?? projects?.[0].id ?? null);
}, [activeProject, data, projectId, projects, isOpen]);
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape") {
onClose();
}
};
window.addEventListener("keydown", handleKeyDown);
return () => {
window.removeEventListener("keydown", handleKeyDown);
};
}, [onClose]);
const addIssueToCycle = async (issueId: string, cycleId: string) => {
if (!workspaceSlug || !activeProject) return;