From 8f28e062fd8faa1ace8da6e44fe265ea2ebeb380 Mon Sep 17 00:00:00 2001 From: Ryan Castner Date: Wed, 8 Apr 2020 11:27:37 -0400 Subject: [PATCH] Use Array.prototype.indexOf instead of Array.prototype.includes to support IE --- core/websock.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/websock.js b/core/websock.js index 00f1a228..fc3f7d1b 100644 --- a/core/websock.js +++ b/core/websock.js @@ -159,7 +159,7 @@ export default class WebChannel { // Send Queue flush() { - if (this._sQlen > 0 && ReadyStates.OPEN.includes(this._rawChannel.readyState)) { + if (this._sQlen > 0 && ReadyStates.OPEN.indexOf(this._rawChannel.readyState) >= 0) { this._rawChannel.send(this._encode_message()); this._sQlen = 0; } @@ -238,8 +238,8 @@ export default class WebChannel { close() { if (this._rawChannel) { - if ((ReadyStates.CONNECTING.includes(this._rawChannel.readyState)) || - (ReadyStates.OPEN.includes(this._rawChannel.readyState))) { + if (ReadyStates.CONNECTING.indexOf(this._rawChannel.readyState) >= 0 || + ReadyStates.OPEN.indexOf(this._rawChannel.readyState) >= 0) { Log.Info(`Closing WebChannel connection`); this._rawChannel.close(); }