diff --git a/src/component/internal/reconnector/index.ts b/src/component/internal/reconnector/index.ts index cec1440b..64e15bb5 100644 --- a/src/component/internal/reconnector/index.ts +++ b/src/component/internal/reconnector/index.ts @@ -165,7 +165,7 @@ export class Reconnector extends EventEmitter { this._total_reconnects++ - if (this._config.max_reconnects > this._total_reconnects || this._total_reconnects < 0) { + if (this._config.max_reconnects > this._total_reconnects || this._config.max_reconnects == -1) { this._timeout = window.setTimeout(this.connect.bind(this), this._config.backoff_ms) } else { this.close(new Error('reconnection failed'))