check ws status to unlock chat on error

This commit is contained in:
anovazzi1 2023-04-25 19:24:56 -03:00
commit 804c9a5a3e

View file

@ -91,6 +91,12 @@ export default function ChatModal({
};
}, []);
useEffect(()=>{
if(ws && ws.CLOSED){
setLockChat(false)
}
},[lockChat])
async function sendAll(data: sendAllProps) {
if (ws) {
ws.send(JSON.stringify(data));