]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: tweak syncing
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 16 Feb 2009 10:16:05 +0000 (13:16 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 16 Feb 2009 10:16:05 +0000 (13:16 +0300)
functions.js
offline.js

index a8cac9a4b127055960d74e0ed7baac80fed66a16..4aa5486a3c1a656372d6d52ed3b67173aee3a205 100644 (file)
@@ -459,8 +459,8 @@ function parse_counters(reply, scheduled_call) {
        
                        if (id == "global-unread") {
 
-                               if (ctr != global_unread) {
-                                       offlineDownloadStart();
+                               if (ctr > global_unread) {
+                                       offlineDownloadStart(1);
                                }
 
                                global_unread = ctr;
index a509cebb02b84dadba6e5843e2199c4d10170b6d..2a4466797f43513705d65a6e5d53d79504828868 100644 (file)
@@ -1618,10 +1618,12 @@ function toggleOfflineModeInfo() {
        }
 }
 
-function offlineDownloadStart() {
+function offlineDownloadStart(stage) {
        try {
+               if (!stage) stage = 0;
+
                if (db && !sync_in_progress && getInitParam("offline_enabled") == "1") {
-                       window.setTimeout("update_offline_data(0)", 100);
+                       window.setTimeout("update_offline_data("+stage+")", 100);
                }
        } catch (e) {
                exception_error("offlineDownloadStart", e);