vim-web 0.3.42-dev.2 → 0.3.42-dev.3

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.
@@ -59929,19 +59929,22 @@ Averrage Date/Second ${avgDataRatePS} kb
59929
59929
  * @param _event - The event object.
59930
59930
  */
59931
59931
  _onClose(_event) {
59932
+ this._logger.log("WebSocket closed.");
59932
59933
  clearTimeout(this._connectionTimeout);
59933
59934
  this._disconnect({ status: "error", error: "connection", serverUrl: this._connectingUrl });
59934
- this._logger.log("WebSocket closed.");
59935
- if (this._retries !== 0) {
59936
- this._logger.log("Attempting to reconnect in 5 seconds");
59937
- this._reconnectTimeout = setTimeout(() => {
59938
- this.updateState({ status: "connecting" });
59939
- this.connect({
59940
- url: this._connectingUrl,
59941
- retries: this._retries - 1
59942
- });
59943
- }, 5e3);
59935
+ if (this._retries === 0) {
59936
+ this._logger.log("No more retries left");
59937
+ this._connectPromise.resolve();
59938
+ return;
59944
59939
  }
59940
+ this._logger.log("Attempting to reconnect in 5 seconds");
59941
+ this._reconnectTimeout = setTimeout(() => {
59942
+ this.updateState({ status: "connecting" });
59943
+ this.connect({
59944
+ url: this._connectingUrl,
59945
+ retries: this._retries - 1
59946
+ });
59947
+ }, 5e3);
59945
59948
  }
59946
59949
  /**
59947
59950
  * Sends binary data over the WebSocket connection.