diff options
author | Samuel Mannehed <samuel@cendio.se> | 2018-08-16 12:07:31 +0200 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2018-08-16 13:33:35 +0200 |
commit | 22000b93d5aa3d12823e7440533e8eb25739e9c0 (patch) | |
tree | e2380c4e54477f20dbef8f252bdeefd2de14952e | |
parent | a793df3d6d472ba028075e4af5410af28a117c82 (diff) | |
download | novnc-22000b93d5aa3d12823e7440533e8eb25739e9c0.tar.gz |
Handle if desktopName isn't set when connected
We can't guarantee that the desktopName event has been fired before the
connect event.
-rw-r--r-- | app/ui.js | 10 | ||||
-rw-r--r-- | vnc_lite.html | 12 |
2 files changed, 17 insertions, 5 deletions
@@ -1074,10 +1074,14 @@ const UI = { UI.inhibit_reconnect = false; let msg; - if (UI.getSetting('encrypt')) { - msg = _("Connected (encrypted) to ") + UI.desktopName; + if (UI.desktopName !== '') { + if (UI.getSetting('encrypt')) { + msg = _("Connected (encrypted) to ") + UI.desktopName; + } else { + msg = _("Connected (unencrypted) to ") + UI.desktopName; + } } else { - msg = _("Connected (unencrypted) to ") + UI.desktopName; + msg = _("Connected"); } UI.showStatus(msg); UI.updateVisualState('connected'); diff --git a/vnc_lite.html b/vnc_lite.html index e5ab3c2..9f766fb 100644 --- a/vnc_lite.html +++ b/vnc_lite.html @@ -131,11 +131,19 @@ function connected(e) { document.getElementById('sendCtrlAltDelButton').disabled = false; + + let encryption; if (WebUtil.getConfigVar('encrypt', (window.location.protocol === "https:"))) { - status("Connected (encrypted) to " + desktopName, "normal"); + encryption = "unencrypted"; + } else { + encryption = "encrypted"; + } + + if (desktopName) { + status("Connected (" + encryption + ") to " + desktopName, "normal"); } else { - status("Connected (unencrypted) to " + desktopName, "normal"); + status("Connected (" + encryption + ")", "normal"); } } |