Simplify logic for status hierarchy
Removes unnecessary variable
This commit is contained in:
committed by
Lauri Kasanen
parent
0bf9403a36
commit
354d544843
@@ -523,19 +523,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);
|
||||
|
||||
Reference in New Issue
Block a user