]> git.wh0rd.org Git - tt-rss.git/commitdiff
parse_counters: properly delete category cache when child_unread changes
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 24 Aug 2012 19:23:03 +0000 (23:23 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 24 Aug 2012 19:23:03 +0000 (23:23 +0400)
js/feedlist.js

index aeb1ac18a10c0311ac56768fa1662e2480286c81..6e11273c5424b03f04d56449eaacbf5c6f73d86f 100644 (file)
@@ -310,8 +310,11 @@ function parse_counters(elems, scheduled_call) {
                                displayNewContentPrompt(id);
                        }
 
-                       if (getFeedUnread(id, (kind == "cat")) != ctr)
+                       if (getFeedUnread(id, (kind == "cat")) != ctr ||
+                                       (kind == "cat" && getCatParam(id) != child_unread)) {
+
                                cache_delete("feed:" + id + ":" + (kind == "cat"));
+                       }
 
                        setFeedUnread(id, (kind == "cat"), ctr);
 
@@ -430,6 +433,14 @@ function setCatParam(cat, value) {
        }
 }
 
+function getCatParam(cat) {
+       try {
+               return getFeedValue(cat, true, "child_unread");
+       } catch (e) {
+               //
+       }
+}
+
 
 function selectFeed(feed, is_cat) {
        try {