From: Andrew Dolgov Date: Fri, 24 Aug 2012 19:23:03 +0000 (+0400) Subject: parse_counters: properly delete category cache when child_unread changes X-Git-Tag: 1.6.0~108 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=183ca8b9407735283a5da6534c6a578070e445d6;p=tt-rss.git parse_counters: properly delete category cache when child_unread changes --- diff --git a/js/feedlist.js b/js/feedlist.js index aeb1ac18..6e11273c 100644 --- a/js/feedlist.js +++ b/js/feedlist.js @@ -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 {