mirror of
https://github.com/JustKato/FreePad.git
synced 2026-02-23 15:50:46 +02:00
* Cleanup
This commit is contained in:
@@ -51,9 +51,14 @@ class PadSocket {
|
||||
updateStatus(`Established`, `text-success`);
|
||||
}
|
||||
|
||||
function onFail() {
|
||||
updateStatus(`Connection Failed`, `text-dangerous`);
|
||||
setTimeout( connectSocket , 1000);
|
||||
}
|
||||
|
||||
// Try and reconnect on failure
|
||||
ws.onclose = connectSocket;
|
||||
ws.onerror = connectSocket;
|
||||
ws.onclose = onFail;
|
||||
ws.onerror = onFail;
|
||||
|
||||
// Assign the websocket
|
||||
this.ws = ws;
|
||||
|
||||
Reference in New Issue
Block a user