From b51cc054be87fe717af6e21d6636a9fd0935ea92 Mon Sep 17 00:00:00 2001 From: Geoff Humphrey Date: Fri, 24 Jun 2022 14:05:57 -0600 Subject: [PATCH] Auto-logout Modal Bug --- js_includes/autologout.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js_includes/autologout.min.js b/js_includes/autologout.min.js index 0bf8a277..72fd8417 100644 --- a/js_includes/autologout.min.js +++ b/js_includes/autologout.min.js @@ -1 +1 @@ -var timeStamp=new Date();sessionStorage.setItem("lastTimeStamp",timeStamp);var visual_updates=true;document.addEventListener('visibilitychange',function(){visual_updates=!document.hidden});function timeChecker(maxMin){setInterval(function(){var storedTimeStamp=sessionStorage.getItem("lastTimeStamp");timeCompare(storedTimeStamp,maxMin)},10000)}function timeCompare(timeString,maxMin){var maxMinutes=maxMin;var currentTime=new Date();var pastTime=new Date(timeString);var timeDiff=currentTime-pastTime;var minPast=Math.floor((timeDiff/60000));if(minPast>=maxMinutes){sessionStorage.removeItem("lastTimeStamp");if(visual_updates){$(".modal").modal('hide');$(".modal-backdrop").remove()}window.location=session_end_redirect;return false}}timeChecker(session_end_min);$("#session-end").countdown(session_end,function(event){if(session_end_min>1440){var end_time=(event.strftime('%D:%H:%M:%S'))}else if(session_end_min>60){var end_time=(event.strftime('%H:%M:%S'))}else{var end_time=(event.strftime('%M:%S'))}$(this).html(end_time);if(visual_updates){if((end_time=="00:02:00")||(end_time=="00:00:02:00")){$(".modal").modal('hide');$(".modal-backdrop").remove();$("#session-expire-warning").modal('show')}if((end_time=="00:00:30")||(end_time=="00:00:00:30")){$(".modal").modal('hide');$(".modal-backdrop").remove();$("#session-expire-warning-30").modal('show')}}}); \ No newline at end of file +var timeStamp=new Date();sessionStorage.setItem("lastTimeStamp",timeStamp);var visual_updates=true;document.addEventListener('visibilitychange',function(){visual_updates=!document.hidden});function timeChecker(maxMin){setInterval(function(){var storedTimeStamp=sessionStorage.getItem("lastTimeStamp");timeCompare(storedTimeStamp,maxMin)},10000)}function timeCompare(timeString,maxMin){var maxMinutes=maxMin;var currentTime=new Date();var pastTime=new Date(timeString);var timeDiff=currentTime-pastTime;var minPast=Math.floor((timeDiff/60000));if(minPast>=maxMinutes){sessionStorage.removeItem("lastTimeStamp");if(visual_updates){$(".modal").modal('hide');$(".modal-backdrop").remove()}window.location=session_end_redirect;return false}}timeChecker(session_end_min);$("#session-end").countdown(session_end,function(event){if(session_end_min>1440){var end_time=(event.strftime('%D:%H:%M:%S'))}else if(session_end_min>60){var end_time=(event.strftime('%H:%M:%S'))}else{var end_time=(event.strftime('%M:%S'))}$(this).html(end_time);if(visual_updates){if((end_time=="02:00")||(end_time=="00:02:00")||(end_time=="00:00:02:00")){$(".modal").modal('hide');$(".modal-backdrop").remove();$("#session-expire-warning").modal('show')}if((end_time=="00:30")||(end_time=="00:00:30")||(end_time=="00:00:00:30")){$(".modal").modal('hide');$(".modal-backdrop").remove();$("#session-expire-warning-30").modal('show')}}}); \ No newline at end of file