summaryrefslogtreecommitdiff
path: root/offline.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-13 09:50:48 +0300
committerAndrew Dolgov <[email protected]>2009-02-13 09:50:48 +0300
commita8caa4c7d30925f270a6ed6e279e52da96fad4b4 (patch)
treeee8ec8f6ff80550d0b874d9f0cfc35e1916e446e /offline.js
parent9ca945a6d28bf3b608f5c6ed41c5ed023eea9878 (diff)
offline: only ask for offline mode when possible
Diffstat (limited to 'offline.js')
-rw-r--r--offline.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/offline.js b/offline.js
index ff09b7167..d9b32cf28 100644
--- a/offline.js
+++ b/offline.js
@@ -1130,9 +1130,7 @@ function init_gears() {
}
}
-function gotoOffline() {
-
-// debug("[Local store] currentVersion = " + store.currentVersion);
+function offlineArticlesStored() {
var rs = db.execute("SELECT COUNT(*) FROM articles");
var count = 0;
@@ -1142,7 +1140,15 @@ function gotoOffline() {
rs.close();
- if (count == 0) {
+ return count;
+}
+
+function gotoOffline() {
+
+// debug("[Local store] currentVersion = " + store.currentVersion);
+
+
+ if (offlineArticlesStored() == 0) {
notify_error("You have to synchronize some articles before going into offline mode.");
return;
}
@@ -1692,7 +1698,7 @@ function offlineSyncShowHideElems(syncing) {
function offlineConfirmModeChange() {
try {
- if (db) {
+ if (db && getInitParam("offline_enabled") == "1" && offlineArticlesStored() > 0) {
var ok = confirm(__("Tiny Tiny RSS has trouble accessing its server. Would you like to go offline?"));
if (ok) {