FIX: Query parameters were not being cleared when changing filtering.
This commit is contained in:
parent
cfedbad0e9
commit
b2b7f4d905
|
@ -19,6 +19,10 @@ const controllerOpts = {
|
||||||
expandGloballyPinned: false,
|
expandGloballyPinned: false,
|
||||||
expandAllPinned: false,
|
expandAllPinned: false,
|
||||||
|
|
||||||
|
resetParams() {
|
||||||
|
this.setProperties({ order: "default", ascending: false });
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
changeSort(sortBy) {
|
changeSort(sortBy) {
|
||||||
|
@ -43,8 +47,7 @@ const controllerOpts = {
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
const filter = this.get('model.filter');
|
const filter = this.get('model.filter');
|
||||||
|
this.resetParams();
|
||||||
this.setProperties({ order: "default", ascending: false });
|
|
||||||
|
|
||||||
// Don't refresh if we're still loading
|
// Don't refresh if we're still loading
|
||||||
if (this.get('discovery.loading')) { return; }
|
if (this.get('discovery.loading')) { return; }
|
||||||
|
|
|
@ -326,6 +326,11 @@ const DiscourseURL = Ember.Object.extend({
|
||||||
if (opts.replaceURL) {
|
if (opts.replaceURL) {
|
||||||
this.replaceState(path);
|
this.replaceState(path);
|
||||||
} else {
|
} else {
|
||||||
|
const discoveryTopics = this.controllerFor('discovery/topics');
|
||||||
|
if (discoveryTopics) {
|
||||||
|
discoveryTopics.resetParams();
|
||||||
|
}
|
||||||
|
|
||||||
router.router.updateURL(path);
|
router.router.updateURL(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue