From eedb8b14b758c8c16249b0dea81ebcdbdccca093 Mon Sep 17 00:00:00 2001 From: Fernando Zanutto Date: Tue, 23 Apr 2024 19:25:47 -0300 Subject: [PATCH] fix: add handleCloseClick to useEffect dependency --- src/renderer/components/modal/modal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/modal/modal.tsx b/src/renderer/components/modal/modal.tsx index cc75db26..f2575e1f 100644 --- a/src/renderer/components/modal/modal.tsx +++ b/src/renderer/components/modal/modal.tsx @@ -57,7 +57,7 @@ export function Modal({ window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); - }, []); + }, [handleCloseClick]); useEffect(() => { const onMouseDown = (e: MouseEvent) => { @@ -74,7 +74,7 @@ export function Modal({ window.addEventListener("mousedown", onMouseDown); return () => window.removeEventListener("mousedown", onMouseDown); - }, []); + }, [handleCloseClick]); useEffect(() => { dispatch(toggleDragging(visible));