summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
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() {