From: Andrew Dolgov Date: Mon, 16 Feb 2009 10:16:05 +0000 (+0300) Subject: offline: tweak syncing X-Git-Tag: 1.3.1~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=65c0779b7750e1c80827d852d97b8ca233f7454e;p=tt-rss.git offline: tweak syncing --- diff --git a/functions.js b/functions.js index a8cac9a4..4aa5486a 100644 --- a/functions.js +++ b/functions.js @@ -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; diff --git a/offline.js b/offline.js index a509cebb..2a446679 100644 --- a/offline.js +++ b/offline.js @@ -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);