FIX: Reset results on query redirect (#236)
# Problem When switching group reports it was possible to have the `results` from a previous run (of a query) pass over to the rendering of a different query. # Fix Set the controllers `results` to `null` when first rendering the query https://user-images.githubusercontent.com/50783505/228050384-5231f004-1dc2-4867-8d57-9db7706bb65f.mov
This commit is contained in:
parent
f589864ce1
commit
a208c1b054
|
@ -1,6 +1,5 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default class GroupReportsIndexRoute extends DiscourseRoute {
|
||||
model() {
|
||||
|
@ -27,10 +26,4 @@ export default class GroupReportsIndexRoute extends DiscourseRoute {
|
|||
setupController(controller, model) {
|
||||
controller.setProperties(model);
|
||||
}
|
||||
|
||||
@action
|
||||
refreshModel() {
|
||||
this.refresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default class GroupReportsShowRoute extends DiscourseRoute {
|
||||
model(params) {
|
||||
|
@ -20,6 +19,8 @@ export default class GroupReportsShowRoute extends DiscourseRoute {
|
|||
model: Object.assign({ params: queryParams }, query),
|
||||
group,
|
||||
queryGroup,
|
||||
results: null,
|
||||
showResults: false,
|
||||
};
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -30,14 +31,4 @@ export default class GroupReportsShowRoute extends DiscourseRoute {
|
|||
setupController(controller, model) {
|
||||
controller.setProperties(model);
|
||||
}
|
||||
|
||||
deactivate() {
|
||||
this.controller.showResults = false;
|
||||
}
|
||||
|
||||
@action
|
||||
refreshModel() {
|
||||
this.refresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue