updateCurrentUnread: don't crash if counter element is not available

master
Andrew Dolgov 5 years ago
parent 9f70bb010a
commit f83836ade9

@ -547,13 +547,15 @@ define(["dojo/_base/declare"], function (declare) {
return tmp.firstChild;
},
updateCurrentUnread: function() {
const feed_unread = Feeds.getUnread(Feeds.getActive(), Feeds.activeIsCat());
if ($("feed_current_unread")) {
const feed_unread = Feeds.getUnread(Feeds.getActive(), Feeds.activeIsCat());
if (feed_unread > 0 && !Element.visible("feeds-holder")) {
$("feed_current_unread").innerText = feed_unread;
Element.show("feed_current_unread");
} else {
Element.hide("feed_current_unread");
if (feed_unread > 0 && !Element.visible("feeds-holder")) {
$("feed_current_unread").innerText = feed_unread;
Element.show("feed_current_unread");
} else {
Element.hide("feed_current_unread");
}
}
},
onLoaded: function (transport, offset, append) {

Loading…
Cancel
Save