From c5c78f09920bdf0c92e83ea97418b04dc046d9ec Mon Sep 17 00:00:00 2001 From: Michael Rasmussen Date: Thu, 4 Jun 2015 01:14:06 +0200 Subject: [PATCH] Fix timer --- js/timer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/timer.js b/js/timer.js index d166ffd..4825655 100644 --- a/js/timer.js +++ b/js/timer.js @@ -8,7 +8,7 @@ function myTimer() { var expire = timeStart - elapsed; var timeLeft = Math.round(((expire % 86400000) % 3600000) / 60000); - if (timeLeft < 1) { + if (timeLeft < 0) { clearInterval(timerRef); console.log('Session expired, reload page'); last = -1; @@ -16,7 +16,7 @@ function myTimer() { } else if (timeLeft < 2) { if (timeLeft < last || last == -1) { last = timeLeft; - timeLeft = 'Expired'; + timeLeft = '< ' + timeLeft + ' min'; console.log('Session soon to expire'); document.getElementById("time").style.background = "red"; document.getElementById("timer").innerHTML = timeLeft; -- 2.39.2