automatically reconnect ws
This commit is contained in:
parent
3d87374e6c
commit
55cb005cbf
@ -1,3 +1,4 @@
|
||||
function openWebSocket() {
|
||||
window.ws = new WebSocket("/custom/ws");
|
||||
window.ws.onmessage = (e) => {
|
||||
const msg = JSON.parse(e.data);
|
||||
@ -11,6 +12,11 @@ window.ws.onmessage = (e) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
window.ws.onclose = function() {
|
||||
setTimeout(openWebSocket, 3000);
|
||||
};
|
||||
}
|
||||
openWebSocket();
|
||||
|
||||
let loginOrRegisterPending = false;
|
||||
window.registerSubmit = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user