change lock logic

This commit is contained in:
anovazzi1 2023-04-25 22:16:07 -03:00
commit ce2895f1c7

View file

@ -99,7 +99,7 @@ export default function ChatModal({
} }
// Do something with the data received from the WebSocket // 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); setWs(newWs);
return () => { return () => {
@ -107,11 +107,6 @@ export default function ChatModal({
}; };
}, []); }, []);
useEffect(()=>{
if(ws && ws.CLOSED){
setLockChat(false)
}
},[lockChat])
async function sendAll(data: sendAllProps) { async function sendAll(data: sendAllProps) {
if (ws) { if (ws) {