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 151b39a commit b83ba90Copy full SHA for b83ba90
src/hooks/chat.js
@@ -52,8 +52,8 @@ function bind(socketChat) {
52
};
53
}
54
55
-export default function reconnect() {
56
- if (!isActive() || guestMode.isSet() || reconnectAttempts > 3 || global('socketChat', { throws: false })?.readyState !== WebSocket.CLOSED) return;
+export default function reconnect(force = false) {
+ if (!force && (!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`);
59
globalSet('socketChat', socket);
0 commit comments