From 47fb32b06d29827f87fb06f51cc1bf5e21688187 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Nov 2010 01:00:51 +0300 Subject: [PATCH] make forced counter update not count as scheduled one --- functions.js | 4 ++++ tt-rss.js | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/functions.js b/functions.js index 6da8dc80..e1f7d1e1 100644 --- a/functions.js +++ b/functions.js @@ -469,6 +469,10 @@ function parse_counters(reply, scheduled_call) { if (feedctr && feedu && feedr) { +// if (id == getActiveFeedId()) +// console.log("HAS CTR: " + feedu.innerHTML + " GOT CTR: " + ctr + +// " IS_SCHED: " + scheduled_call); + if (parseInt(ctr) > 0 && parseInt(feedu.innerHTML) < parseInt(ctr) && id == getActiveFeedId() && scheduled_call) { diff --git a/tt-rss.js b/tt-rss.js index 4226fd8d..b09f880d 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -203,11 +203,11 @@ function timeout() { new Ajax.Request("backend.php", { parameters: query_str, onComplete: function(transport) { - handle_rpc_reply(transport, true); + handle_rpc_reply(transport, !_force_scheduled_update); + _force_scheduled_update = false; } }); last_scheduled_update = ts; - _force_scheduled_update = false; } } catch (e) { @@ -1291,6 +1291,7 @@ function handle_rpc_reply(transport, scheduled_call) { message = message.firstChild.nodeValue; if (message == "UPDATE_COUNTERS") { + console.log("need to refresh counters..."); setInitParam("last_article_id", -1); _force_scheduled_update = true; } -- 2.39.5