diff options
author | Samuel Mannehed <samuel@cendio.se> | 2019-11-25 17:03:55 +0100 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2019-11-25 17:03:55 +0100 |
commit | b17f6c692939af3edb11e2c1d30ab3ee0f6717f0 (patch) | |
tree | b4ee9937a72524be2e459880a9e7c28ecc0b0bc4 | |
parent | afa1f8a2ab541d95de7ca2ae19d4f88b1a36e627 (diff) | |
download | novnc-b17f6c692939af3edb11e2c1d30ab3ee0f6717f0.tar.gz |
Simplify logic for status hierarchy
Removes unnecessary variable
-rw-r--r-- | app/ui.js | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -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); |