Simplify logic for status hierarchy

Removes unnecessary variable
pull/36/head
Samuel Mannehed 6 years ago committed by Lauri Kasanen
parent 0bf9403a36
commit 354d544843

@ -523,20 +523,15 @@ const UI = {
// Don't overwrite more severe visible statuses and never // Don't overwrite more severe visible statuses and never
// errors. Only shows the first error. // errors. Only shows the first error.
let visible_status_type = 'none';
if (statusElem.classList.contains("noVNC_open")) { if (statusElem.classList.contains("noVNC_open")) {
if (statusElem.classList.contains("noVNC_status_error")) { if (statusElem.classList.contains("noVNC_status_error")) {
visible_status_type = 'error'; return;
} else if (statusElem.classList.contains("noVNC_status_warn")) {
visible_status_type = 'warn';
} else {
visible_status_type = 'normal';
}
} }
if (visible_status_type === 'error' || if (statusElem.classList.contains("noVNC_status_warn") &&
(visible_status_type === 'warn' && status_type === 'normal')) { status_type === 'normal') {
return; return;
} }
}
clearTimeout(UI.statusTimeout); clearTimeout(UI.statusTimeout);

Loading…
Cancel
Save