check ws status to unlock chat on error
This commit is contained in:
parent
f36fe34831
commit
804c9a5a3e
1 changed files with 6 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue