From c8c6034a7a88184b15bf062a5e5b5368ead6bdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 26 Nov 2015 23:44:15 +0100 Subject: [PATCH] missed the CategoryList constant --- .../discourse/controllers/discovery/categories.js.es6 | 8 ++++---- .../discourse/routes/build-category-route.js.es6 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 index c4d639f3612..83b493076ff 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 @@ -12,7 +12,6 @@ export default DiscoveryController.extend({ actions: { refresh() { - // Don't refresh if we're still loading if (this.get('controllers.discovery.loading')) { return; } @@ -21,9 +20,10 @@ export default DiscoveryController.extend({ // Lesson learned: Don't call `loading` yourself. this.set('controllers.discovery.loading', true); + const CategoryList = require('discourse/models/category-list').default; const parentCategory = this.get('model.parentCategory'); - const promise = parentCategory ? Discourse.CategoryList.listForParent(this.store, parentCategory) : - Discourse.CategoryList.list(this.store); + const promise = parentCategory ? CategoryList.listForParent(this.store, parentCategory) : + CategoryList.list(this.store); const self = this; promise.then(function(list) { @@ -38,7 +38,7 @@ export default DiscoveryController.extend({ }.property(), latestTopicOnly: function() { - return this.get('model.categories').find(function(c) { return c.get('featuredTopics.length') > 1; }) === undefined; + return this.get('model.categories').find(c => c.get('featuredTopics.length') > 1) === undefined; }.property('model.categories.@each.featuredTopics.length') }); diff --git a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 index 18c959979f0..d0abb2dde57 100644 --- a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 @@ -37,8 +37,8 @@ export default (filter, params) => { _createSubcategoryList(category) { this._categoryList = null; if (Em.isNone(category.get('parentCategory')) && Discourse.SiteSettings.show_subcategory_list) { - return Discourse.CategoryList.listForParent(this.store, category) - .then(list => this._categoryList = list); + const CategoryList = require('discourse/models/category-list').default; + return CategoryList.listForParent(this.store, category).then(list => this._categoryList = list); } // If we're not loading a subcategory list just resolve