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 56d449d commit 3e8cfa3Copy full SHA for 3e8cfa3
reconnecting-websocket.js
@@ -201,12 +201,13 @@
201
this.open = function (reconnectAttempt) {
202
ws = new WebSocket(self.url, protocols || []);
203
204
- if (!reconnectAttempt) {
+ if (reconnectAttempt) {
205
+ if (this.maxReconnectAttempts && this.reconnectAttempts > this.maxReconnectAttempts) {
206
+ return;
207
+ }
208
+ } else {
209
eventTarget.dispatchEvent(generateEvent('connecting'));
- }
-
- if (this.maxReconnectAttempts && this.reconnectAttempts > this.maxReconnectAttempts) {
- return;
210
+ this.reconnectAttempts = 0;
211
}
212
213
if (self.debug || ReconnectingWebSocket.debugAll) {
0 commit comments