]> git.wh0rd.org Git - tt-rss.git/commitdiff
make forced counter update not count as scheduled one
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 22:00:51 +0000 (01:00 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 22:00:51 +0000 (01:00 +0300)
functions.js
tt-rss.js

index 6da8dc8070f89f2dd3e686a21207116433bef746..e1f7d1e1dd8124f112de49334d3096875ec6f0fb 100644 (file)
@@ -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) {
index 4226fd8da4e28a3f4d927e72fda284759f89e374..b09f880d574b1d224f36d340a6cd89dbf60afe9d 100644 (file)
--- 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;
                                }