mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Review Queue Query parameters were not refreshing in Ember CLI builds (#13101)
The problem was we were setting the properties then immediately calling `refreshRoute` which was being executed before the properties were settled via the runloop.
This commit is contained in:
parent
e2f9da9795
commit
e1b99d3cad
@ -2,6 +2,7 @@ import Controller from "@ember/controller";
|
|||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { isPresent } from "@ember/utils";
|
import { isPresent } from "@ember/utils";
|
||||||
|
import { next } from "@ember/runloop";
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
queryParams: [
|
queryParams: [
|
||||||
@ -93,6 +94,10 @@ export default Controller.extend({
|
|||||||
this.setProperties(range);
|
this.setProperties(range);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
refreshModel() {
|
||||||
|
next(() => this.send("refreshRoute"));
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
remove(ids) {
|
remove(ids) {
|
||||||
if (!ids) {
|
if (!ids) {
|
||||||
@ -104,7 +109,7 @@ export default Controller.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (newList.length === 0) {
|
if (newList.length === 0) {
|
||||||
this.send("refreshRoute");
|
this.refreshModel();
|
||||||
} else {
|
} else {
|
||||||
this.set("reviewables", newList);
|
this.set("reviewables", newList);
|
||||||
}
|
}
|
||||||
@ -112,7 +117,7 @@ export default Controller.extend({
|
|||||||
|
|
||||||
resetTopic() {
|
resetTopic() {
|
||||||
this.set("topic_id", null);
|
this.set("topic_id", null);
|
||||||
this.send("refreshRoute");
|
this.refreshModel();
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
@ -165,7 +170,7 @@ export default Controller.extend({
|
|||||||
additional_filters: JSON.stringify(this.additionalFilters),
|
additional_filters: JSON.stringify(this.additionalFilters),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.send("refreshRoute");
|
this.refreshModel();
|
||||||
},
|
},
|
||||||
|
|
||||||
loadMore() {
|
loadMore() {
|
||||||
|
Loading…
Reference in New Issue
Block a user