FIX: Only use cached list when we have less than 1 page worth of topics.
We only need it then to maintain the scroll position.
This commit is contained in:
parent
f4f54fd49b
commit
5dea3720a4
|
@ -206,8 +206,9 @@ Discourse.TopicList.reopenClass({
|
||||||
if (extras.cached) {
|
if (extras.cached) {
|
||||||
var cachedList = session.get('topicList');
|
var cachedList = session.get('topicList');
|
||||||
|
|
||||||
// Try to use the cached version
|
// Try to use the cached version if it exists and is greater than the topics per page
|
||||||
if (cachedList && (cachedList.get('filter') === filter) &&
|
if (cachedList && (cachedList.get('filter') === filter) &&
|
||||||
|
(cachedList.get('topics.length') || 0) > Discourse.SiteSettings.topics_per_page &&
|
||||||
_.isEqual(cachedList.get('listParams'), filterParams)) {
|
_.isEqual(cachedList.get('listParams'), filterParams)) {
|
||||||
cachedList.set('loaded', true);
|
cachedList.set('loaded', true);
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,7 @@ basic:
|
||||||
topics_per_page:
|
topics_per_page:
|
||||||
default: 30
|
default: 30
|
||||||
min: 1
|
min: 1
|
||||||
|
client: true
|
||||||
show_subcategory_list:
|
show_subcategory_list:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
client: true
|
||||||
|
|
Loading…
Reference in New Issue