Commit 5281790c by Justin Riley

clear javascript timer after access granted

parent 28a48e58
......@@ -73,6 +73,10 @@ procrel = (function(){
do_pp_get('status', function(data){
console.log(data);
if (data.enabled) {
if (timeout != null) {
console.log("Disabling timer");
clearTimeout(timeout);
}
alert ("Access Granted!");
location.reload();
}
......@@ -81,10 +85,12 @@ procrel = (function(){
var check_count = 0;
var timeout = null;
var periodic_check = function() {
check_count = check_count + 1;
if (check_count < 100){ // >
setTimeout(periodic_check, 2000);
timeout = setTimeout(periodic_check, 2000);
}
check_access();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment