From ce2895f1c798c6b537d1344ca81499bc4f29fe33 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 25 Apr 2023 22:16:07 -0300 Subject: [PATCH] change lock logic --- src/frontend/src/modals/chatModal/index.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 2f614c545..c06ac0e47 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -99,7 +99,7 @@ export default function ChatModal({ } // Do something with the data received from the WebSocket }; - newWs.onclose=(e)=>{console.log(e.reason)} + newWs.onclose=(e)=>{console.log(e.reason);setLockChat(false)} setWs(newWs); return () => { @@ -107,11 +107,6 @@ export default function ChatModal({ }; }, []); - useEffect(()=>{ - if(ws && ws.CLOSED){ - setLockChat(false) - } - },[lockChat]) async function sendAll(data: sendAllProps) { if (ws) {