summaryrefslogtreecommitdiff
path: root/js/reader.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/reader.js
parent787cb6732840a7f0bb1d28bd076e8d16f329a59a (diff)
show git version in the UI
Diffstat (limited to 'js/reader.js')
-rw-r--r--js/reader.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/js/reader.js b/js/reader.js
index b1db806..a38513e 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -322,17 +322,17 @@ const Reader = {
});
});
- localforage.getItem("epube.cache-timestamp").then(function(stamp) {
- let msg = "V: ";
-
- if (parseInt(stamp))
- msg += new Date(stamp*1000).toLocaleString("en-GB");
- else
- msg += "Unknown";
-
- msg += " (" + (App.isOnline() ? "Online" : "Offline") + ")";
-
- $(".last-mod-timestamp").text(msg)
+ Promise.all([
+ localforage.getItem("epube.cache-timestamp"),
+ localforage.getItem("epube.cache-version")
+ ]).then((res) => {
+ const stamp = res[0];
+ const version = res[1];
+
+ $(".last-mod-timestamp").html(`${version}
+ &mdash; ${parseInt(stamp) ? new Date(stamp*1000).toLocaleString("en-GB") : "Unknown"}
+ (${App.isOnline() ? `<span class='text-success'>Online</span>` : `<span class='text-danger'>Offline</span>`})
+ `);
});
localforage.getItem("epube.fontFamily").then(function(font) {