]> git.wh0rd.org Git - tt-rss.git/commitdiff
loadMoreHeadlines: fix for unread view
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 28 Aug 2012 12:02:44 +0000 (16:02 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 28 Aug 2012 12:02:44 +0000 (16:02 +0400)
decrementFeedCounter: do not apply counter hacks when dealing with
subcategory entries

js/feedlist.js

index 6e11273c5424b03f04d56449eaacbf5c6f73d86f..aec93862fb745d3146d8500ea4a0f54e19344c8c 100644 (file)
@@ -19,7 +19,6 @@ function loadMoreHeadlines() {
                var offset = 0;
 
                var view_mode = document.forms["main_toolbar_form"].view_mode.value;
-               var num_unread = getFeedUnread(getActiveFeedId(), activeFeedIsCat());
                var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
                var num_all = $$("#headlines-frame > div[id*=RROW]").length;
 
@@ -32,9 +31,9 @@ function loadMoreHeadlines() {
                        console.warn("loadMoreHeadlines: published is not implemented, falling back.");
                        offset = num_all;
                } else if (view_mode == "unread") {
-                       offset = num_unread;
+                       offset = unread_in_buffer;
                } else if (view_mode == "adaptive") {
-                       if (num_unread > 0)
+                       if (unread_in_buffer > 0)
                                offset = unread_in_buffer;
                        else
                                offset = num_all;
@@ -575,6 +574,11 @@ function catchupFeed(feed, is_cat) {
 
 function decrementFeedCounter(feed, is_cat) {
        try {
+               // we have subcats, no way to figure out if this article is
+               // actually from this category
+               if (is_cat && getCatParam(feed) > 0)
+                       return;
+
                var ctr = getFeedUnread(feed, is_cat);
 
                if (ctr > 0) {