summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-11-19 07:59:26 +0300
committerAndrew Dolgov <[email protected]>2020-11-19 07:59:26 +0300
commit94e0592f456880e72a8d8114db80e2288958c638 (patch)
tree4055fcd6609ec1f609a595c3807437e08703185a /js/app.js
parent521a040b7a460688675f1d5c0eac46bfe1a24883 (diff)
WIP: check online status via app if possible
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/app.js b/js/app.js
index b12ce03..d886eb5 100644
--- a/js/app.js
+++ b/js/app.js
@@ -199,8 +199,14 @@ const App = {
.html("Could not communicate with service worker. Try reloading the page.");
}
},
+ onLine: function() {
+ if (typeof EpubeApp != "undefined" && typeof EpubeApp.isOnline != "undefined")
+ return EpubeApp.isOnline;
+ else
+ return navigator.onLine;
+ },
appCheckOffline: function() {
- EpubeApp.setOffline(!navigator.onLine);
+ EpubeApp.setOffline(!App.onLine);
},
initOfflineEvents: function() {
if (typeof EpubeApp != "undefined") {
@@ -212,7 +218,7 @@ const App = {
EpubeApp.setOffline(true);
});
- EpubeApp.setOffline(!navigator.onLine);
+ EpubeApp.setOffline(!App.onLine);
}
},
initNightMode: function() {