mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 03:25:56 +00:00
update cache when viewing unread articles
This commit is contained in:
36
viewfeed.js
36
viewfeed.js
@@ -247,30 +247,38 @@ function showArticleInHeadlines(id) {
|
|||||||
var article_is_unread = crow.className.match("Unread");
|
var article_is_unread = crow.className.match("Unread");
|
||||||
|
|
||||||
crow.className = crow.className.replace("Unread", "");
|
crow.className = crow.className.replace("Unread", "");
|
||||||
|
|
||||||
|
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
|
||||||
|
markHeadline(id);
|
||||||
|
|
||||||
var upd_img_pic = document.getElementById("FUPDPIC-" + id);
|
var upd_img_pic = document.getElementById("FUPDPIC-" + id);
|
||||||
|
|
||||||
|
var cache_prefix = "";
|
||||||
|
|
||||||
|
if (activeFeedIsCat()) {
|
||||||
|
cache_prefix = "C:";
|
||||||
|
} else {
|
||||||
|
cache_prefix = "F:";
|
||||||
|
}
|
||||||
|
|
||||||
if (upd_img_pic && upd_img_pic.src.match("updated.png")) {
|
if (upd_img_pic && upd_img_pic.src.match("updated.png")) {
|
||||||
upd_img_pic.src = "images/blank_icon.gif";
|
upd_img_pic.src = "images/blank_icon.gif";
|
||||||
|
|
||||||
var cache_prefix = "";
|
|
||||||
|
|
||||||
if (activeFeedIsCat()) {
|
|
||||||
cache_prefix = "C:";
|
|
||||||
} else {
|
|
||||||
cache_prefix = "F:";
|
|
||||||
}
|
|
||||||
|
|
||||||
cache_invalidate(cache_prefix + getActiveFeedId());
|
cache_invalidate(cache_prefix + getActiveFeedId());
|
||||||
|
|
||||||
cache_inject(cache_prefix + getActiveFeedId(),
|
cache_inject(cache_prefix + getActiveFeedId(),
|
||||||
document.getElementById("headlines-frame").innerHTML,
|
document.getElementById("headlines-frame").innerHTML,
|
||||||
get_feed_unread(getActiveFeedId()));
|
get_feed_unread(getActiveFeedId()));
|
||||||
|
|
||||||
|
} else if (article_is_unread) {
|
||||||
|
|
||||||
|
cache_invalidate(cache_prefix + getActiveFeedId());
|
||||||
|
|
||||||
|
cache_inject(cache_prefix + getActiveFeedId(),
|
||||||
|
document.getElementById("headlines-frame").innerHTML,
|
||||||
|
get_feed_unread(getActiveFeedId())-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false);
|
|
||||||
markHeadline(id);
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("showArticleInHeadlines", e);
|
exception_error("showArticleInHeadlines", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user