aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/js.html
diff options
context:
space:
mode:
authorKevin Hamer <kevin@imarc.com>2020-10-11 15:31:58 -0400
committerMantas Vilčinskas <hi@mnts.lt>2020-10-27 21:38:46 +0200
commite8e50381292a6532cdc3c2802f37262b279fe30b (patch)
tree6d1b6d32bee3da0284c2c54eda3dc45043aceb8d /layouts/partials/js.html
parentb5d07632d40437bb87c3faf7b9ece7ca412dce9f (diff)
fix automatic reload logic
Diffstat (limited to 'layouts/partials/js.html')
-rw-r--r--layouts/partials/js.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index b398fbe..fbe102c 100644
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -88,8 +88,8 @@
lastUpdated.innerHTML = '{{ T "lastChecked" }} ' + timeSince(lastUpdate) + ' {{ T "someTimeAgo" }}';
// Refresh almost every 5m
- if (lastUpdate > 290000) {
- location.reload;
+ if (Math.floor(new Date() - lastUpdate) > 290000) {
+ location.reload();
}
}
}, 5000)