diff options
author | tdro <tdro@noreply.example.com> | 2023-04-10 14:14:10 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-04-10 14:14:10 -0400 |
commit | 1a083c05f74ba929da347263c91f1479bb66d221 (patch) | |
tree | 65fd3c3b5ca8b8956b7fb01acd5baccbbb15dada | |
parent | 7c8233d964507ab9b37706f066f7744dde744c99 (diff) | |
download | canory-1a083c05f74ba929da347263c91f1479bb66d221.tar.gz canory-1a083c05f74ba929da347263c91f1479bb66d221.tar.bz2 canory-1a083c05f74ba929da347263c91f1479bb66d221.zip |
static/js/refresh: Jitter is within seconds
-rw-r--r-- | assets/js/index.js | 6 | ||||
-rw-r--r-- | static/js/refresh.ts | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/assets/js/index.js b/assets/js/index.js index 0d15055..98b53d2 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -81,9 +81,9 @@ check(url, "HEAD", function(request) { const local = document.querySelector('meta[name="last-modified"]').content; const remote = request.getResponseHeader("last-modified") || local; - const localHour = local.substring(0, local.length - 9); - const remoteHour = remote.substring(0, remote.length - 9); - const modified = localHour !== remoteHour; + const localSecond = local.substring(0, local.length - 5); + const remoteSecond = remote.substring(0, remote.length - 5); + const modified = localSecond !== remoteSecond; if (modified) { const indicator = document.querySelector("a[data-update]"); check(url, "GET"); diff --git a/static/js/refresh.ts b/static/js/refresh.ts index 88710fa..d308014 100644 --- a/static/js/refresh.ts +++ b/static/js/refresh.ts @@ -17,9 +17,9 @@ check(url, "HEAD", function (request) { const local = document.querySelector('meta[name="last-modified"]').content; const remote = request.getResponseHeader("last-modified") || local; - const localHour = local.substring(0, local.length - 9); - const remoteHour = remote.substring(0, remote.length - 9); - const modified = localHour !== remoteHour; + const localSecond = local.substring(0, local.length - 5); + const remoteSecond = remote.substring(0, remote.length - 5); + const modified = localSecond !== remoteSecond; if (modified) { const indicator = document.querySelector("a[data-update]"); |