From 7be220c2d2ce38910f3267f7dd2fb4b40173d50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 30 Jul 2021 22:32:30 +0200 Subject: [PATCH] infinite reconnects for -1 value. --- src/component/internal/reconnector/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'))