]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Simplify logic for status hierarchy
authorSamuel Mannehed <samuel@cendio.se>
Mon, 25 Nov 2019 16:03:55 +0000 (17:03 +0100)
committerSamuel Mannehed <samuel@cendio.se>
Mon, 25 Nov 2019 16:03:55 +0000 (17:03 +0100)
Removes unnecessary variable

app/ui.js

index 0eca9a4bdfa4ec04eb67929743ad99820e53a079..ddd0a49070ae613a22140cf52a7f3ab6fa5f081d 100644 (file)
--- 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);