summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-04-08 19:54:49 +0300
committerAndrew Dolgov <[email protected]>2021-04-08 19:54:49 +0300
commitca5c66775a1c5d7928931cfead8ae4ac9d7b479a (patch)
tree0c3e8653fad3c090c466d6fb2ec3a80a786da59c /js/app.js
parent787cb6732840a7f0bb1d28bd076e8d16f329a59a (diff)
show git version in the UI
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/app.js b/js/app.js
index 0eaa5aa..02a6fb7 100644
--- a/js/app.js
+++ b/js/app.js
@@ -39,6 +39,7 @@ const App = {
_dl_progress_timeout: false,
index_mode: "",
last_mtime: -1,
+ version: "UNKNOWN",
csrf_token: "",
init: function() {
let refreshed_files = 0;
@@ -97,6 +98,7 @@ const App = {
if (event.data == 'client-reload') {
localforage.setItem("epube.cache-timestamp", App.last_mtime);
+ localforage.setItem("epube.cache-version", App.version);
window.location.reload()
}
@@ -183,7 +185,7 @@ const App = {
refreshCache: function(force) {
if ('serviceWorker' in navigator) {
localforage.getItem("epube.cache-timestamp").then(function(stamp) {
- console.log('stamp', stamp, 'last mtime', App.last_mtime);
+ console.log('stamp', stamp, 'last mtime', App.last_mtime, 'version', App.version);
if (force || stamp != App.last_mtime) {
console.log('asking worker to refresh cache');