summaryrefslogtreecommitdiff
path: root/app/ui.js
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2019-11-25 16:38:03 +0100
committerSamuel Mannehed <samuel@cendio.se>2019-11-25 16:38:03 +0100
commitafa1f8a2ab541d95de7ca2ae19d4f88b1a36e627 (patch)
treee62389503820c7ec3facf74bdb07da8106b8f049 /app/ui.js
parent686c8d259a14e2194a6091f0b4360799bf30598e (diff)
downloadnovnc-afa1f8a2ab541d95de7ca2ae19d4f88b1a36e627.tar.gz
Ensure warning status timeouts are honored
When showing a new status popup we want to set a timer for how long to show it. In cases where we show many statuses in a fast succession we need to remove any running timeouts when showing a new one. There are exceptions when new statuses won't be shown, and thats if a more severe status is already showing, i.e and error or a warning. Warnings can still have timeouts. There was a bug that occured when we tried to show a normal status while a warning was showing. The bug caused the warning status timeout to be removed even if the normal status was never shown. We should only remove running timeouts if we're actually going to show a new status.
Diffstat (limited to 'app/ui.js')
-rw-r--r--app/ui.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/ui.js b/app/ui.js
index 48e4d13..0eca9a4 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -447,8 +447,6 @@ const UI = {
showStatus(text, status_type, time) {
const statusElem = document.getElementById('noVNC_status');
- clearTimeout(UI.statusTimeout);
-
if (typeof status_type === 'undefined') {
status_type = 'normal';
}
@@ -470,6 +468,8 @@ const UI = {
return;
}
+ clearTimeout(UI.statusTimeout);
+
switch (status_type) {
case 'error':
statusElem.classList.remove("noVNC_status_warn");