Try fixing ws
This commit is contained in:
parent
cce42995b9
commit
088d78d762
2 changed files with 6 additions and 1 deletions
|
@ -60,6 +60,11 @@ function EventReceiver(websocket, poller, channels, last_msg, onmessage) {
|
||||||
this.websocket.onclose = function (event) {
|
this.websocket.onclose = function (event) {
|
||||||
if (event.code != 1000 && receiver.onwsclose !== null)
|
if (event.code != 1000 && receiver.onwsclose !== null)
|
||||||
receiver.onwsclose(event);
|
receiver.onwsclose(event);
|
||||||
|
if (event.code == 1006) {
|
||||||
|
setTimeout(function() {
|
||||||
|
connect();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.websocket = null;
|
this.websocket = null;
|
||||||
|
|
|
@ -115,7 +115,7 @@ let META_HEADER = [
|
||||||
console.log('Navigated away');
|
console.log('Navigated away');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('You probably should refresh?');
|
console.log('Refreshing ws');
|
||||||
};
|
};
|
||||||
|
|
||||||
return receiver;
|
return receiver;
|
||||||
|
|
Loading…
Reference in a new issue