mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing issues around missing feeds. Also fixing issue with scrolling in temp Feed view.
This commit is contained in:
parent
d5061f4674
commit
ef6ba48dc3
4 changed files with 29 additions and 28 deletions
|
@ -606,6 +606,12 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
return counts;
|
||||
},
|
||||
|
||||
unfetched_feeds: function() {
|
||||
return this.feeds.filter(function(feed) {
|
||||
return feed.get('active') && !feed.get('fetched_once') && !feed.get('has_exception');
|
||||
});
|
||||
},
|
||||
|
||||
set_feed: function(feed_id, feed) {
|
||||
if (!feed) {
|
||||
feed = feed_id;
|
||||
|
|
|
@ -174,7 +174,6 @@ NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
|
|||
comparator: function(modelA, modelB) {
|
||||
var sort_order = NEWSBLUR.assets.preference('feed_order');
|
||||
|
||||
|
||||
if (modelA.is_feed() != modelB.is_feed()) {
|
||||
// Feeds above folders
|
||||
return modelA.is_feed() ? -1 : 1;
|
||||
|
@ -187,6 +186,11 @@ NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
|
|||
var feedA = modelA.feed;
|
||||
var feedB = modelB.feed;
|
||||
|
||||
if (!feedA || !feedB) {
|
||||
// console.log(["missing feed", feedA, feedB, modelA, modelB]);
|
||||
return !feedA ? 1 : -1;
|
||||
}
|
||||
|
||||
if (sort_order == 'ALPHABETICAL' || !sort_order) {
|
||||
return feedA.get('feed_title').toLowerCase() > feedB.get('feed_title').toLowerCase() ? 1 : -1;
|
||||
} else if (sort_order == 'MOSTUSED') {
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
this.setup_howitworks_hovers();
|
||||
this.setup_interactions_module();
|
||||
this.setup_activities_module();
|
||||
this.setup_unfetched_feed_check();
|
||||
},
|
||||
|
||||
// ========
|
||||
|
@ -1967,32 +1968,6 @@
|
|||
// = Story Pane - Feed View =
|
||||
// ==========================
|
||||
|
||||
make_story_feed_entries: function(stories, first_load, options) {
|
||||
var $feed_view = this.$s.$feed_view;
|
||||
var $stories = this.$s.$feed_stories;
|
||||
var self = this;
|
||||
var unread_view = this.get_unread_view_score();
|
||||
var river_same_feed;
|
||||
var feed = this.model.get_feed(this.active_feed);
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (first_load && !options.refresh_load) {
|
||||
$('.NB-feed-story-endbar', $feed_view).remove();
|
||||
}
|
||||
|
||||
for (var s in stories) {
|
||||
// REMOVED
|
||||
|
||||
}
|
||||
|
||||
if (!stories || !stories.length) {
|
||||
// this.fetch_story_locations_in_feed_view({'reset_timer': true});
|
||||
}
|
||||
|
||||
if (first_load) NEWSBLUR.app.story_list.show_stories_preference_in_feed_view(true);
|
||||
},
|
||||
|
||||
apply_story_styling: function(reset_stories) {
|
||||
var $body = this.$s.$body;
|
||||
$body.removeClass('NB-theme-sans-serif');
|
||||
|
@ -4091,6 +4066,21 @@
|
|||
}, $.noop);
|
||||
},
|
||||
|
||||
// ===================
|
||||
// = Unfetched Feeds =
|
||||
// ===================
|
||||
|
||||
setup_unfetched_feed_check: function() {
|
||||
this.locks.unfetched_feed_check = setInterval(_.bind(function() {
|
||||
var unfetched_feeds = NEWSBLUR.assets.unfetched_feeds();
|
||||
if (unfetched_feeds.length) {
|
||||
_.each(unfetched_feeds, _.bind(function(feed) {
|
||||
this.force_instafetch_stories(feed.id);
|
||||
}, this));
|
||||
}
|
||||
}, this), 60*10*1000);
|
||||
},
|
||||
|
||||
// ==========
|
||||
// = Events =
|
||||
// ==========
|
||||
|
|
|
@ -613,7 +613,8 @@ NEWSBLUR.Views.OriginalTabView = Backbone.View.extend({
|
|||
toggle_selected_story: function(model, selected, options) {
|
||||
if (selected &&
|
||||
NEWSBLUR.reader.story_view == 'page' &&
|
||||
!options.selected_in_original) {
|
||||
!options.selected_in_original &&
|
||||
!options.selected_by_scrolling) {
|
||||
var found = this.scroll_to_selected_story(model);
|
||||
NEWSBLUR.reader.switch_to_correct_view(found);
|
||||
if (!found) {
|
||||
|
|
Loading…
Add table
Reference in a new issue