mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FEATURE: stop watching for new suggested topics
This commit is contained in:
parent
4cf33ca59a
commit
c3767dff6a
1 changed files with 0 additions and 29 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue