FIX: ensures ordering set in tags-show queryString works at first load (#6951)

FIX: ensures ordering set in tags-show queryString works at first load (#6951)

diff --git a/app/assets/javascripts/discourse/routes/tags-show.js.es6 b/app/assets/javascripts/discourse/routes/tags-show.js.es6
index 72a02c2..c4d7edd 100644
--- a/app/assets/javascripts/discourse/routes/tags-show.js.es6
+++ b/app/assets/javascripts/discourse/routes/tags-show.js.es6
@@ -6,6 +6,11 @@ import PermissionType from "discourse/models/permission-type";
 export default Discourse.Route.extend({
   navMode: "latest",
 
+  queryParams: {
+    ascending: { refreshModel: true },
+    order: { refreshModel: true }
+  },
+
   renderTemplate() {
     const controller = this.controllerFor("tags.show");
     this.render("tags.show", { controller });
@@ -60,11 +65,13 @@ export default Discourse.Route.extend({
     return tag;
   },
 
-  afterModel(tag) {
+  afterModel(tag, transition) {
     const controller = this.controllerFor("tags.show");
     controller.set("loading", true);
 
     const params = controller.getProperties("order", "ascending");
+    params.order = transition.queryParams.order || params.order;
+    params.ascending = transition.queryParams.ascending || params.ascending;
 
     const categorySlug = this.get("categorySlug");
     const parentCategorySlug = this.get("parentCategorySlug");

GitHub sha: 7caa28cf

This commit has been mentioned on Discourse Meta. There might be relevant details there: