aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/js/index.js2
-rw-r--r--static/js/refresh.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index f2c4ae4..1e267b9 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -80,8 +80,8 @@
function update() {
const url = self.location.href.split("#")[0].split("?")[0];
check(url, "HEAD", function(request) {
- const remote = request.getResponseHeader("last-modified") || local;
const local = document.querySelector('meta[name="last-modified"]').content;
+ const remote = request.getResponseHeader("last-modified") || local;
const modified = Date.parse(document.lastModified) !== Date.parse(remote);
const drift = Date.parse(remote) - Date.parse(local);
if (modified) {
diff --git a/static/js/refresh.ts b/static/js/refresh.ts
index 2a8a089..2b96751 100644
--- a/static/js/refresh.ts
+++ b/static/js/refresh.ts
@@ -16,8 +16,8 @@
function update() {
const url = self.location.href.split("#")[0].split("?")[0];
check(url, "HEAD", function (request) {
- const remote = request.getResponseHeader("last-modified") || local;
const local = document.querySelector('meta[name="last-modified"]').content;
+ const remote = request.getResponseHeader("last-modified") || local;
const modified = Date.parse(document.lastModified) !== Date.parse(remote);
const drift = Date.parse(remote) - Date.parse(local);