From ac49453bd8af68270eb6e5c0564394e3e8b1b0a8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Nov 2010 11:36:56 +0300 Subject: [PATCH] fix _force_scheduled_update handling --- tt-rss.js | 7 ++++++- viewfeed.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tt-rss.js b/tt-rss.js index 44c0b608e..841d4b337 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -163,6 +163,8 @@ function timeout() { if (ts - last_scheduled_update > 10 || _force_scheduled_update) { + //console.log("timeout()"); + window.clearTimeout(counter_timeout_id); var query_str = "?op=rpc&subop=getAllCounters"; @@ -181,7 +183,9 @@ function timeout() { } query_str = query_str + "&omode=" + omode; - query_str = query_str + "&last_article_id=" + getInitParam("last_article_id"); + + if (!_force_scheduled_update) + query_str = query_str + "&last_article_id=" + getInitParam("last_article_id"); //console.log("[timeout]" + query_str); @@ -192,6 +196,7 @@ function timeout() { } }); last_scheduled_update = ts; + _force_scheduled_update = false; } } catch (e) { diff --git a/viewfeed.js b/viewfeed.js index f46b97863..4dacb2003 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -323,6 +323,9 @@ function showArticleInHeadlines(id) { markHeadline(id); + if (article_is_unread) + _force_scheduled_update = true; + } catch (e) { exception_error("showArticleInHeadlines", e); }