mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-07 18:38:42 +00:00
feat(chat-window): fix WS connection errors
This commit is contained in:
@ -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]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user