summaryrefslogtreecommitdiff
path: root/js/FeedStoreModel.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-19 14:06:23 +0300
committerAndrew Dolgov <[email protected]>2021-03-19 14:06:23 +0300
commit718c9f07fa24a5457757d6903221630acbf2957c (patch)
tree766a07b58e2cdd7ee9e7821c97634c1504bf7e2b /js/FeedStoreModel.js
parent43ea36d030a1880b3309ea46e6da8cc207d5ec0e (diff)
remove model.getNextUnreadFeed; unify code with feedTree.getNextFeed
Diffstat (limited to 'js/FeedStoreModel.js')
-rw-r--r--js/FeedStoreModel.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/js/FeedStoreModel.js b/js/FeedStoreModel.js
index 736bfbed6..befc441af 100644
--- a/js/FeedStoreModel.js
+++ b/js/FeedStoreModel.js
@@ -54,45 +54,6 @@ define(["dojo/_base/declare", "dijit/tree/ForestStoreModel"], function (declare)
if (treeItem)
return this.store.setValue(treeItem, key, value);
},
- getNextUnreadFeed: function (feed, is_cat) {
- if (!this.store._itemsByIdentity)
- return null;
-
- let treeItem;
-
- if (is_cat) {
- treeItem = this.store._itemsByIdentity['CAT:' + feed];
- } else {
- treeItem = this.store._itemsByIdentity['FEED:' + feed];
- }
-
- const items = this.store._arrayOfAllItems;
-
- for (let i = 0; i < items.length; i++) {
- if (items[i] == treeItem) {
-
- for (let j = i + 1; j < items.length; j++) {
- const unread = this.store.getValue(items[j], 'unread');
- const id = this.store.getValue(items[j], 'id');
-
- if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
- if (!is_cat || !(this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed)) return items[j];
- }
- }
-
- for (let j = 0; j < i; j++) {
- const unread = this.store.getValue(items[j], 'unread');
- const id = this.store.getValue(items[j], 'id');
-
- if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
- if (!is_cat || !(this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed)) return items[j];
- }
- }
- }
- }
-
- return null;
- },
hasCats: function () {
if (this.store && this.store._itemsByIdentity)
return this.store._itemsByIdentity['CAT:-1'] != undefined;