]> git.datanom.net - qtadmin.git/commitdiff
Fix timer
authorMichael Rasmussen <mir@datanom.net>
Wed, 3 Jun 2015 23:09:10 +0000 (01:09 +0200)
committerMichael Rasmussen <mir@datanom.net>
Wed, 3 Jun 2015 23:09:10 +0000 (01:09 +0200)
js/timer.js

index 45883c686366cd4105b429de6b0433531905d052..d166ffd1abf26a11fbd4ce29d2e8903a7ba24c31 100644 (file)
@@ -8,16 +8,16 @@ function myTimer() {
     var expire = timeStart - elapsed;
     var timeLeft = Math.round(((expire % 86400000) % 3600000) / 60000);
 
-    if (timeLeft < 0) {
+    if (timeLeft < 1) {
         clearInterval(timerRef);
         console.log('Session expired, reload page');
         last = -1;
         location.reload();
-    } else if (timeLeft < 1) {
+    } else if (timeLeft < 2) {
         if (timeLeft < last || last == -1) {
             last = timeLeft;
             timeLeft = 'Expired';
-            console.log('Session valid < 1');
+            console.log('Session soon to expire');
             document.getElementById("time").style.background = "red";
             document.getElementById("timer").innerHTML = timeLeft;
         }
This page took 0.030518 seconds and 5 git commands to generate.