From 26186ee6afeca4bd893dd848a3422d0ecb16ac7a Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Fri, 24 Jan 2020 04:26:14 +0530 Subject: [PATCH] FIX: topics sorting in tag pages is broken. --- .../discourse/controllers/tags-show.js.es6 | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/tags-show.js.es6 b/app/assets/javascripts/discourse/controllers/tags-show.js.es6 index bc26a7febc5..9b49d57082b 100644 --- a/app/assets/javascripts/discourse/controllers/tags-show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/tags-show.js.es6 @@ -5,6 +5,7 @@ import discourseComputed, { observes } from "discourse-common/utils/decorators"; import BulkTopicSelection from "discourse/mixins/bulk-topic-selection"; import NavItem from "discourse/models/nav-item"; import FilterModeMixin from "discourse/mixins/filter-mode"; +import { queryParams } from "discourse/controllers/discovery-sortable"; export default Controller.extend(BulkTopicSelection, FilterModeMixin, { application: inject(), @@ -53,15 +54,7 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, { ); }, - queryParams: [ - "order", - "ascending", - "status", - "state", - "search", - "max_posts", - "q" - ], + queryParams: Object.keys(queryParams), @discourseComputed("category", "tag.id", "filterType", "noSubcategories") navItems(category, tagId, filterType, noSubcategories) { @@ -116,7 +109,7 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, { this.setProperties({ order, ascending: false }); } - this.send("invalidateModel"); + this.transitionToRoute({ queryParams: { order, ascending: this.ascending }}); }, toggleInfo() {