X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/b2103a3c75bff8e351718591bdd6f1771f4077a3..1e354d2079b77adb249465d86e86fa8a59f9dc4e:/js/timer.js diff --git a/js/timer.js b/js/timer.js index 45883c6..f68f084 100644 --- a/js/timer.js +++ b/js/timer.js @@ -13,16 +13,16 @@ function myTimer() { console.log('Session expired, reload page'); last = -1; location.reload(); - } else if (timeLeft < 1) { + } else if (timeLeft == 1) { if (timeLeft < last || last == -1) { last = timeLeft; - timeLeft = 'Expired'; - console.log('Session valid < 1'); + timeLeft = '< ' + timeLeft + ' min'; + console.log('Session soon to expire'); document.getElementById("time").style.background = "red"; document.getElementById("timer").innerHTML = timeLeft; } } else { - if (timeLeft < last || last == -1) { + if ((timeLeft < last && timeLeft > 0) || last == -1) { last = timeLeft; console.log('Session valid < ' + timeLeft); timeLeft = '< ' + timeLeft + ' min';