summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2018-08-16 12:07:31 +0200
committerSamuel Mannehed <samuel@cendio.se>2018-08-16 13:33:35 +0200
commit22000b93d5aa3d12823e7440533e8eb25739e9c0 (patch)
treee2380c4e54477f20dbef8f252bdeefd2de14952e
parenta793df3d6d472ba028075e4af5410af28a117c82 (diff)
downloadnovnc-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.js10
-rw-r--r--vnc_lite.html12
2 files changed, 17 insertions, 5 deletions
diff --git a/app/ui.js b/app/ui.js
index c03f8d3..045c64f 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -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");
}
}