FIX: Query parameters were not being cleared when changing filtering.

This commit is contained in:
Robin Ward 2017-02-27 15:47:56 -05:00
parent cfedbad0e9
commit b2b7f4d905
2 changed files with 10 additions and 2 deletions

View File

@ -19,6 +19,10 @@ const controllerOpts = {
expandGloballyPinned: false,
expandAllPinned: false,
resetParams() {
this.setProperties({ order: "default", ascending: false });
},
actions: {
changeSort(sortBy) {
@ -43,8 +47,7 @@ const controllerOpts = {
refresh() {
const filter = this.get('model.filter');
this.setProperties({ order: "default", ascending: false });
this.resetParams();
// Don't refresh if we're still loading
if (this.get('discovery.loading')) { return; }

View File

@ -326,6 +326,11 @@ const DiscourseURL = Ember.Object.extend({
if (opts.replaceURL) {
this.replaceState(path);
} else {
const discoveryTopics = this.controllerFor('discovery/topics');
if (discoveryTopics) {
discoveryTopics.resetParams();
}
router.router.updateURL(path);
}