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