mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
Refresh if idle > 60min
This commit is contained in:
parent
2b846e88a8
commit
ab968a4744
1 changed files with 16 additions and 0 deletions
|
|
@ -1,5 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
/* Refresh page if idle > 60m */
|
||||
var REFRESH_FREQUENCY = 3600000;
|
||||
var refresh;
|
||||
var refresher = function() {
|
||||
window.location.reload(true);
|
||||
};
|
||||
|
||||
var awaitIdle = function() {
|
||||
if(refresh) clearTimeout(refresh);
|
||||
refresh = setTimeout(refresher, REFRESH_FREQUENCY);
|
||||
};
|
||||
|
||||
awaitIdle();
|
||||
$(document).on('mousemove keydown mousedown touchstart', awaitIdle);
|
||||
/* Refresh page if idle > 60m */
|
||||
|
||||
window.habitrpg = angular.module('habitrpg',
|
||||
['ui.bootstrap', 'ui.keypress', 'ui.router', 'chieffancypants.loadingBar', 'At', 'infinite-scroll', 'ui.select2', 'angular.filter', 'ngResource', 'ngSanitize'])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue