diff options
author | Devaev Maxim <[email protected]> | 2018-07-16 05:16:53 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-16 05:16:53 +0300 |
commit | 211401b52c1d334b50dede28bab0a3a6e056992e (patch) | |
tree | cb2389d5b9a061ae1b2eb4919e0195374e043513 /kvmd/web/js/session.js | |
parent | 52bf4f38e42852818354ca7f182b589a2f09631d (diff) |
minor js fixes
Diffstat (limited to 'kvmd/web/js/session.js')
-rw-r--r-- | kvmd/web/js/session.js | 11 |
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); } } }; |