From b17f6c692939af3edb11e2c1d30ab3ee0f6717f0 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 25 Nov 2019 17:03:55 +0100 Subject: [PATCH] Simplify logic for status hierarchy Removes unnecessary variable --- app/ui.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/ui.js b/app/ui.js index 0eca9a4b..ddd0a490 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);