From c3767dff6a3bbbcd4d74b3243fc72ce3303adbda Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 31 Oct 2014 15:15:40 +1100 Subject: [PATCH] FEATURE: stop watching for new suggested topics --- .../javascripts/discourse/views/topic.js.es6 | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/app/assets/javascripts/discourse/views/topic.js.es6 b/app/assets/javascripts/discourse/views/topic.js.es6 index 0cfc4a3d7..76733c795 100644 --- a/app/assets/javascripts/discourse/views/topic.js.es6 +++ b/app/assets/javascripts/discourse/views/topic.js.es6 @@ -70,35 +70,6 @@ export default Discourse.View.extend(AddCategoryClass, Discourse.Scrolling, { }.on('willDestroyElement'), - debounceLoadSuggested: Discourse.debounce(function(){ - if (this.get('isDestroyed') || this.get('isDestroying')) { return; } - - var incoming = this.get('topicTrackingState.newIncoming'), - suggested = this.get('topic.details.suggested_topics'), - topicId = this.get('topic.id'); - - if(suggested) { - var existing = _.invoke(suggested, 'get', 'id'), - lookup = _.chain(incoming) - .last(Discourse.SiteSettings.suggested_topics) - .reverse() - .union(existing) - .uniq() - .without(topicId) - .first(Discourse.SiteSettings.suggested_topics) - .value(); - - Discourse.TopicList.loadTopics(lookup, "").then(function(topics){ - suggested.clear(); - suggested.pushObjects(topics); - }); - } - }, 1000), - - hasNewSuggested: function(){ - this.debounceLoadSuggested(); - }.observes('topicTrackingState.incomingCount'), - gotFocus: function(){ if (Discourse.get('hasFocus')){ this.scrolled();