@realsee/live 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -633,7 +633,7 @@ class mr extends ue {
633
633
  timeout: 1e4,
634
634
  shouldReconnect: (e, i) => {
635
635
  if (!(e.code === 1008 || e.code === 1011))
636
- return [0, 3e3, 1e4][i.attempts % 3];
636
+ return [3e3, 6e3, 1e4][i.attempts % 3];
637
637
  },
638
638
  should1000Reconnect: !1,
639
639
  ignoreConnectivityEvents: !1,
@@ -737,7 +737,7 @@ class mr extends ue {
737
737
  const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
738
738
  if (!e)
739
739
  return;
740
- this._pendingReconnect = void 0, this._removeWebSocketEvent(), this._realWebSocket = new WebSocket(e, this._protocols || void 0), this._attempts = this._attempts + 1, this.emit(
740
+ this._clearPendingReconnectIfNeeded(), this._removeWebSocketEvent(), this._realWebSocket = new WebSocket(e, this._protocols || void 0), this._attempts = this._attempts + 1, this.emit(
741
741
  "connecting",
742
742
  new CustomEvent("connecting", {
743
743
  detail: { attempts: this._attempts, reconnects: this._reconnects }
@@ -775,7 +775,7 @@ class mr extends ue {
775
775
  * @returns
776
776
  */
777
777
  o(this, "_webSocketOpenHandler", (e) => {
778
- this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
778
+ this._clearPendingReconnectIfNeeded(), this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
779
779
  const i = ++this._reconnects, n = this._attempts;
780
780
  return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit("open", Object.assign(e, { detail: { reconnects: i, attempts: n } }));
781
781
  });