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