diff --git a/js/App.js b/js/App.js index 262988135..dad7723ca 100644 --- a/js/App.js +++ b/js/App.js @@ -1198,19 +1198,19 @@ const App = { } }; this.hotkey_actions["goto_read"] = () => { - Feeds.open({feed: -6}); + Feeds.open({feed: Feeds.FEED_RECENTLY_READ}); }; this.hotkey_actions["goto_all"] = () => { - Feeds.open({feed: -4}); + Feeds.open({feed: Feeds.FEED_ALL}); }; this.hotkey_actions["goto_fresh"] = () => { - Feeds.open({feed: -3}); + Feeds.open({feed: Feeds.FEED_FRESH}); }; this.hotkey_actions["goto_marked"] = () => { - Feeds.open({feed: -1}); + Feeds.open({feed: Feeds.FEED_STARRED}); }; this.hotkey_actions["goto_published"] = () => { - Feeds.open({feed: -2}); + Feeds.open({feed: Feeds.FEED_PUBLISHED}); }; this.hotkey_actions["goto_prefs"] = () => { App.openPreferences(); diff --git a/js/FeedTree.js b/js/FeedTree.js index f6c44a71e..3eaa61263 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -225,8 +225,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co if (item.auxcounter > 0) rc += " Has_Aux"; if (item.markedcounter > 0) rc += " Has_Marked"; if (item.updates_disabled > 0) rc += " UpdatesDisabled"; - if (item.bare_id >= App.LABEL_BASE_INDEX && item.bare_id < 0 && !is_cat || item.bare_id == 0 && !is_cat) rc += " Special"; - if (item.bare_id == -1 && is_cat) rc += " AlwaysVisible"; + if (item.bare_id >= App.LABEL_BASE_INDEX && item.bare_id < 0 && !is_cat || item.bare_id == Feeds.FEED_ARCHIVED && !is_cat) rc += " Special"; + if (item.bare_id == Feeds.CATEGORY_SPECIAL && is_cat) rc += " AlwaysVisible"; if (item.bare_id < App.LABEL_BASE_INDEX) rc += " Label"; return rc; diff --git a/js/Feeds.js b/js/Feeds.js index 42641dc74..d84255310 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -3,6 +3,19 @@ /* global __, App, Headlines, xhr, dojo, dijit, fox, PluginHost, Notify, fox */ const Feeds = { + FEED_ARCHIVED: 0, + FEED_STARRED: -1, + FEED_PUBLISHED: -2, + FEED_FRESH: -3, + FEED_ALL: -4, + FEED_NOTHING: -5, + FEED_RECENTLY_READ: -6, + FEED_ERROR: -7, + CATEGORY_UNCATEGORIZED: 0, + CATEGORY_SPECIAL: -1, + CATEGORY_LABELS: -2, + CATEGORY_ALL_EXCEPT_VIRTUAL: -3, + CATEGORY_ALL: -4, _default_feed_id: -3, counters_last_request: 0, _active_feed_id: undefined, diff --git a/js/Headlines.js b/js/Headlines.js index 2be3cd697..be17bf832 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -307,7 +307,7 @@ const Headlines = { offset = unread_in_buffer; break; case "adaptive": - if (!(Feeds.getActive() == -1 && !Feeds.activeIsCat())) + if (!(Feeds.getActive() == Feeds.FEED_STARRED && !Feeds.activeIsCat())) offset = num_unread > 0 ? unread_in_buffer : num_all; break; } @@ -746,7 +746,7 @@ const Headlines = { feed_id = reply['headlines']['id']; Feeds.last_search_query = reply['headlines']['search_query']; - if (feed_id != -7 && (feed_id != Feeds.getActive() || is_cat != Feeds.activeIsCat())) + if (feed_id != Feeds.FEED_ERROR && (feed_id != Feeds.getActive() || is_cat != Feeds.activeIsCat())) return; const headlines_count = reply['headlines-info']['count'];