From 296d347fe04602e2798e072de21c222c7f95b51c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 17 Nov 2019 15:46:56 +0300 Subject: service worker: only hardcode return of read.html etc while offline, try to return cached data if online request failed index: notify to reload the page initially because of SW bullshit --- js/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/index.js') diff --git a/js/index.js b/js/index.js index 9aadc00..2ec8508 100644 --- a/js/index.js +++ b/js/index.js @@ -28,9 +28,10 @@ function cache_refresh(force) { .html("Could not communicate with service worker. Try reloading the page."); } else { localforage.setItem("epube.initial-load-done", true).then(function() { - window.setTimeout(function() { - window.location.reload(); - }, 1000); + $(".dl-progress") + .show() + .addClass("alert-info") + .html("Please reload the page once to activate service worker and populate offline cache."); }); } -- cgit v1.2.3