From ac72b0bcf62e7c5d4e6574a39c568bbd0c637b60 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Oct 2014 12:17:53 -0400 Subject: [PATCH] FIX: Bug when sorting by category column, navigating to home --- .../javascripts/discourse/routes/build-category-route.js.es6 | 4 +++- .../javascripts/discourse/routes/build-topic-route.js.es6 | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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 26d753eb43a..75e50345142 100644 --- a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 @@ -79,7 +79,9 @@ export default function(filter, params) { category: model, period: periods.findBy('id', periodId), selected: [], - noSubcategories: params && !!params.no_subcategories + noSubcategories: params && !!params.no_subcategories, + order: model.get('params.order'), + ascending: model.get('params.ascending'), }); this.controllerFor('search').set('searchContext', model.get('searchContext')); diff --git a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 index 3b764cc6a7d..2e98877ca97 100644 --- a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 @@ -45,6 +45,7 @@ export default function(filter, extras) { return 'queryParams.' + v; }))); + var periods = this.controllerFor('discovery').get('periods'), periodId = model.get('for_period') || (filter.indexOf('/') > 0 ? filter.split('/')[1] : ''); @@ -52,7 +53,9 @@ export default function(filter, extras) { model: model, category: null, period: periods.findBy('id', periodId), - selected: [] + selected: [], + order: model.get('params.order'), + ascending: model.get('params.ascending'), }); this.openTopicDraft(model);