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:
Robin Ward 2014-09-10 15:17:51 -04:00
parent f4f54fd49b
commit 5dea3720a4
2 changed files with 4 additions and 2 deletions

View File

@ -206,9 +206,10 @@ Discourse.TopicList.reopenClass({
if (extras.cached) {
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) &&
_.isEqual(cachedList.get('listParams'), filterParams)) {
(cachedList.get('topics.length') || 0) > Discourse.SiteSettings.topics_per_page &&
_.isEqual(cachedList.get('listParams'), filterParams)) {
cachedList.set('loaded', true);
if (tracking) {

View File

@ -154,6 +154,7 @@ basic:
topics_per_page:
default: 30
min: 1
client: true
show_subcategory_list:
default: false
client: true