From 96b432d127d3df009f5a34d3b6a89ba3663f6516 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 11 Jul 2023 11:58:48 -0300 Subject: [PATCH] fix(formModal): remove connectWS from dependencies array in useEffect to prevent unnecessary reconnections fix(formModal): remove connectWS from dependencies array in useEffect to prevent unnecessary reconnections --- src/frontend/src/modals/formModal/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index d0a73f941..e80bc6c35 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -292,7 +292,8 @@ export default function FormModal({ ws.current.close(); } }; - }, [connectWS]); + // do not add connectWS on dependencies array + }, []); useEffect(() => { if ( @@ -303,7 +304,8 @@ export default function FormModal({ connectWS(); setLockChat(false); } - }, [lockChat, connectWS]); + // do not add connectWS on dependencies array + }, [lockChat]); async function sendAll(data: sendAllProps) { try {