FIX: Suggested Topics had a hardcoded 5 and was ignoring the
SiteSetting
This commit is contained in:
parent
f5e6bcc585
commit
9929560c40
|
@ -107,22 +107,20 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
debounceLoadSuggested: Discourse.debounce(function(){
|
debounceLoadSuggested: Discourse.debounce(function(){
|
||||||
if (this.get('isDestroyed') || this.get('isDestroying')) { return; }
|
if (this.get('isDestroyed') || this.get('isDestroying')) { return; }
|
||||||
|
|
||||||
var incoming = this.get('topicTrackingState.newIncoming');
|
var incoming = this.get('topicTrackingState.newIncoming'),
|
||||||
var suggested = this.get('topic.details.suggested_topics');
|
suggested = this.get('topic.details.suggested_topics'),
|
||||||
var topicId = this.get('topic.id');
|
topicId = this.get('topic.id');
|
||||||
|
|
||||||
if(suggested) {
|
if(suggested) {
|
||||||
|
var existing = _.invoke(suggested, 'get', 'id'),
|
||||||
var existing = _.invoke(suggested, 'get', 'id');
|
lookup = _.chain(incoming)
|
||||||
|
.last(Discourse.SiteSettings.suggested_topics)
|
||||||
var lookup = _.chain(incoming)
|
.reverse()
|
||||||
.last(5)
|
.union(existing)
|
||||||
.reverse()
|
.uniq()
|
||||||
.union(existing)
|
.without(topicId)
|
||||||
.uniq()
|
.first(Discourse.SiteSettings.suggested_topics)
|
||||||
.without(topicId)
|
.value();
|
||||||
.first(5)
|
|
||||||
.value();
|
|
||||||
|
|
||||||
Discourse.TopicList.loadTopics(lookup, "").then(function(topics){
|
Discourse.TopicList.loadTopics(lookup, "").then(function(topics){
|
||||||
suggested.clear();
|
suggested.clear();
|
||||||
|
|
|
@ -47,7 +47,9 @@ basic:
|
||||||
posts_per_page:
|
posts_per_page:
|
||||||
client: true
|
client: true
|
||||||
default: 20
|
default: 20
|
||||||
suggested_topics: 5
|
suggested_topics:
|
||||||
|
client: true
|
||||||
|
default: 5
|
||||||
enable_mobile_theme:
|
enable_mobile_theme:
|
||||||
client: true
|
client: true
|
||||||
default: true
|
default: true
|
||||||
|
|
Loading…
Reference in New Issue