feat(chat-window): fix WS connection errors
This commit is contained in:
parent
fac41d3812
commit
e1732b9bf2
|
@ -194,8 +194,10 @@ const useSocket = (
|
|||
}
|
||||
|
||||
return () => {
|
||||
ws?.close();
|
||||
console.log('[DEBUG] closed');
|
||||
if (ws?.readyState === 1) {
|
||||
ws?.close();
|
||||
console.log('[DEBUG] closed');
|
||||
}
|
||||
};
|
||||
}, [ws, url, setIsWSReady, setError]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue