We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec7ba91 commit d0fe2cdCopy full SHA for d0fe2cd
src/hooks/chat.js
@@ -13,7 +13,7 @@ const historyIds = new Set();
13
14
function handleClose(event) {
15
console.debug('Disconnected', event);
16
- if (event.code !== 1000) return;
+ if (![1000, 1006].includes(event.code)) return;
17
setTimeout(reconnect, 1000 * reconnectAttempts);
18
}
19
@@ -52,7 +52,7 @@ function bind(socketChat) {
52
};
53
54
55
-function reconnect() {
+export default function reconnect() {
56
if (!isActive() || guestMode.isSet() || reconnectAttempts > 3 || global('socketChat', { throws: false })?.readyState !== WebSocket.CLOSED) return;
57
reconnectAttempts += 1;
58
const socket = new WebSocket(`wss://${location.hostname}/chat`);
0 commit comments