From ca5c66775a1c5d7928931cfead8ae4ac9d7b479a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 8 Apr 2021 19:54:49 +0300 Subject: show git version in the UI --- js/reader.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'js/reader.js') 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} + — ${parseInt(stamp) ? new Date(stamp*1000).toLocaleString("en-GB") : "Unknown"} + (${App.isOnline() ? `Online` : `Offline`}) + `); }); localforage.getItem("epube.fontFamily").then(function(font) { -- cgit v1.2.3