aboutsummaryrefslogtreecommitdiff
path: root/assets/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/index.js')
-rw-r--r--assets/js/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index fc1f6c3..7be41db 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -81,10 +81,10 @@
const url = self.location.href.split("#")[0].split("?")[0];
check(url, "HEAD", function(request) {
const local = document.querySelector('meta[name="last-modified"]').content;
- const remote = request.getResponseHeader("last-modified") || local;
+ const remote = request.getResponseHeader("last-modified") || '';
const modified = Date.parse(document.lastModified) !== Date.parse(remote);
- const drift = Date.parse(remote) - Date.parse(local);
- if (modified) {
+ const drift = Date.parse(remote || local) - Date.parse(local);
+ if (remote && modified) {
const indicator = document.querySelector("a[data-update]");
check(url, "GET");
indicator.href = url;