From 0bf9403a361ccdfdbc8507659319749561c38fe2 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Mon, 25 Nov 2019 16:38:03 +0100 Subject: [PATCH] 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. --- kasmweb/app/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kasmweb/app/ui.js b/kasmweb/app/ui.js index 79614cd..b421d7d 100644 --- a/kasmweb/app/ui.js +++ b/kasmweb/app/ui.js @@ -517,8 +517,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'; } @@ -540,6 +538,8 @@ const UI = { return; } + clearTimeout(UI.statusTimeout); + switch (status_type) { case 'error': statusElem.classList.remove("noVNC_status_warn");