From 2e6d48ead70a376bf19e08c367a08b928aefabb0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Mar 2021 07:39:31 +0300 Subject: [PATCH] * Feeds.openNextUnread: fix * model.getNextFeed: make sure return values are consistent, stop wrapping back to starred --- js/FeedTree.js | 4 ++-- js/Feeds.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/FeedTree.js b/js/FeedTree.js index 4c3c47daf..50a1fe643 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -394,7 +394,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co } const items = this.model.store._arrayOfAllItems; - let item = items[0]; + let item = false; for (let i = 0; i < items.length; i++) { if (items[i] == treeItem) { @@ -422,7 +422,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co return [this.model.store.getValue(item, 'bare_id'), !this.model.store.getValue(item, 'id').match('FEED:')]; } else { - return false; + return [false, false]; } }, getPreviousFeed: function (feed, is_cat) { diff --git a/js/Feeds.js b/js/Feeds.js index f8e64235d..2c468c934 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -133,9 +133,10 @@ const Feeds = { return Feeds.reloadCurrent(''); }, openNextUnread: function() { - const is_cat = this.activeIsCat(); - const nuf = this.getNextUnread(this.getActive(), is_cat); - if (nuf) this.open({feed: nuf, is_cat: is_cat}); + const [feed, is_cat] = this.getNextUnread(this.getActive(), this.activeIsCat()); + + if (feed !== false) + this.open({feed: feed, is_cat: is_cat}); }, toggle: function() { Element.toggle("feeds-holder");