FeedStoreModel.getFeedUnread: return -1 when value is unset

This commit is contained in:
Andrew Dolgov 2019-05-07 06:03:44 +03:00
parent 9368f1a07f
commit 2ce31fd0bf

View File

@ -31,7 +31,7 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
}, },
getFeedUnread: function (feed, is_cat) { getFeedUnread: function (feed, is_cat) {
const unread = parseInt(this.getFeedValue(feed, is_cat, 'unread')); const unread = parseInt(this.getFeedValue(feed, is_cat, 'unread'));
return (isNaN(unread)) ? 0 : unread; return (isNaN(unread)) ? -1 : unread;
}, },
setFeedUnread: function (feed, is_cat, unread) { setFeedUnread: function (feed, is_cat, unread) {
return this.setFeedValue(feed, is_cat, 'unread', parseInt(unread)); return this.setFeedValue(feed, is_cat, 'unread', parseInt(unread));