diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 index 7c356c7c8..a25502d66 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 @@ -37,6 +37,8 @@ var controllerOpts = { var filter = this.get('model.filter'), self = this; + this.setProperties({ order: 'default', ascending: false }); + // Don't refresh if we're still loading if (this.get('controllers.discovery.loading')) { return; } diff --git a/app/assets/javascripts/discourse/lib/url.js b/app/assets/javascripts/discourse/lib/url.js index b7fe81d1a..046244979 100644 --- a/app/assets/javascripts/discourse/lib/url.js +++ b/app/assets/javascripts/discourse/lib/url.js @@ -250,7 +250,10 @@ Discourse.URL = Em.Object.createWithMixins({ navigatedToHome: function(oldPath, path) { var homepage = Discourse.Utilities.defaultHomepage(); - if (window.history && window.history.pushState && path === "/" && (oldPath === "/" || oldPath === "/" + homepage)) { + if (window.history && + window.history.pushState && + (path === "/" || path === "/" + homepage) && + (oldPath === "/" || oldPath === "/" + homepage)) { this.appEvents.trigger('url:refresh'); return true; } diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs index eb4076efb..9b5cd67a1 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs @@ -37,17 +37,13 @@ {{/if}} {{/if}} - {{#sortable-heading sortBy="default" action="changeSort" order=order ascending=ascending}} - {{i18n topic.title}} - {{/sortable-heading}} + {{#sortable-heading}} {{i18n topic.title}} {{/sortable-heading}} {{#unless controller.hideCategory}} {{#sortable-heading sortBy="category" action="changeSort" order=order ascending=ascending}} {{i18n category_title}} {{/sortable-heading}} {{/unless}} - {{#sortable-heading sortBy="posters" action="changeSort" order=order ascending=ascending}} - {{i18n users}} - {{/sortable-heading}} + {{#sortable-heading}} {{i18n users}} {{/sortable-heading}} {{#sortable-heading sortBy="posts" number=true action="changeSort" order=order ascending=ascending}} {{i18n posts}} {{/sortable-heading}}