summaryrefslogtreecommitdiff
path: root/kvmd/web/js/session.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-16 05:16:53 +0300
committerDevaev Maxim <[email protected]>2018-07-16 05:16:53 +0300
commit211401b52c1d334b50dede28bab0a3a6e056992e (patch)
treecb2389d5b9a061ae1b2eb4919e0195374e043513 /kvmd/web/js/session.js
parent52bf4f38e42852818354ca7f182b589a2f09631d (diff)
minor js fixes
Diffstat (limited to 'kvmd/web/js/session.js')
-rw-r--r--kvmd/web/js/session.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/kvmd/web/js/session.js b/kvmd/web/js/session.js
index c46d228e..b4642b62 100644
--- a/kvmd/web/js/session.js
+++ b/kvmd/web/js/session.js
@@ -32,8 +32,11 @@ var session = new function() {
var __wsErrorHandler = function(event) {
tools.error("WebSocket error:", event);
- __ws.close();
- __ws = null;
+ if (__ws) {
+ __ws.onclose = null;
+ __ws.close();
+ __wsCloseHandler(null);
+ }
};
var __wsCloseHandler = function(event) {
@@ -44,6 +47,7 @@ var session = new function() {
}
hid.clearCapture();
atx.clearLeds();
+ __ws = null;
setTimeout(session.startPoller, 1000);
};
@@ -57,8 +61,9 @@ var session = new function() {
} catch (err) {
tools.error("Ping error:", err.message);
if (__ws) {
+ __ws.onclose = null;
__ws.close();
- __ws = null;
+ __wsCloseHandler(null);
}
}
};