summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2019-11-25 17:03:55 +0100
committerSamuel Mannehed <samuel@cendio.se>2019-11-25 17:03:55 +0100
commitb17f6c692939af3edb11e2c1d30ab3ee0f6717f0 (patch)
treeb4ee9937a72524be2e459880a9e7c28ecc0b0bc4
parentafa1f8a2ab541d95de7ca2ae19d4f88b1a36e627 (diff)
downloadnovnc-b17f6c692939af3edb11e2c1d30ab3ee0f6717f0.tar.gz
Simplify logic for status hierarchy
Removes unnecessary variable
-rw-r--r--app/ui.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/app/ui.js b/app/ui.js
index 0eca9a4..ddd0a49 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -453,19 +453,14 @@ const UI = {
// Don't overwrite more severe visible statuses and never
// errors. Only shows the first error.
- let visible_status_type = 'none';
if (statusElem.classList.contains("noVNC_open")) {
if (statusElem.classList.contains("noVNC_status_error")) {
- visible_status_type = 'error';
- } else if (statusElem.classList.contains("noVNC_status_warn")) {
- visible_status_type = 'warn';
- } else {
- visible_status_type = 'normal';
+ return;
+ }
+ if (statusElem.classList.contains("noVNC_status_warn") &&
+ status_type === 'normal') {
+ return;
}
- }
- if (visible_status_type === 'error' ||
- (visible_status_type === 'warn' && status_type === 'normal')) {
- return;
}
clearTimeout(UI.statusTimeout);