From 17eb0fcf504e366bb501e55fdc8784ab1f632897 Mon Sep 17 00:00:00 2001 From: samhed Date: Wed, 24 Aug 2016 16:35:44 +0200 Subject: [PATCH] Trigger autoconnect at proper time It needs to happen after everything is fully initialised. --- app/ui.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/ui.js b/app/ui.js index 78d397d7..81b7a2d4 100644 --- a/app/ui.js +++ b/app/ui.js @@ -115,14 +115,6 @@ var UI; UI.initSetting('repeaterID', ''); UI.initSetting('token', ''); - var autoconnect = WebUtil.getConfigVar('autoconnect', false); - if (autoconnect === 'true' || autoconnect == '1') { - autoconnect = true; - UI.connect(); - } else { - autoconnect = false; - } - UI.updateVisualState(); document.getElementById('noVNC_setting_host').focus(); @@ -194,6 +186,14 @@ var UI; // Add mouse event click/focus/blur event handlers to the UI UI.addMouseHandlers(); + var autoconnect = WebUtil.getConfigVar('autoconnect', false); + if (autoconnect === 'true' || autoconnect == '1') { + autoconnect = true; + UI.connect(); + } else { + autoconnect = false; + } + if (typeof callback === "function") { callback(UI.rfb); }