Use Array.prototype.indexOf instead of Array.prototype.includes to support IE
This commit is contained in:
parent
5e72400c5a
commit
8f28e062fd
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue