mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
FIX: Reset max_posts query parameter (#10334)
This commit is contained in:
parent
ac76bfb400
commit
12913a46e4
@ -10,6 +10,7 @@ import PermissionType from "discourse/models/permission-type";
|
||||
import CategoryList from "discourse/models/category-list";
|
||||
import Category from "discourse/models/category";
|
||||
import { Promise, all } from "rsvp";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
// A helper function to create a category route with parameters
|
||||
export default (filterArg, params) => {
|
||||
@ -229,9 +230,26 @@ export default (filterArg, params) => {
|
||||
});
|
||||
},
|
||||
|
||||
resetParams(controller) {
|
||||
controller.setProperties({
|
||||
order: "default",
|
||||
ascending: false,
|
||||
max_posts: null
|
||||
});
|
||||
},
|
||||
|
||||
@action
|
||||
willTransition() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.controller) {
|
||||
this.resetParams(this.controller);
|
||||
}
|
||||
},
|
||||
|
||||
resetController(controller, isExiting) {
|
||||
if (isExiting) {
|
||||
controller.setProperties({ order: "default", ascending: false });
|
||||
this.resetParams(controller);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -6,6 +6,7 @@ import { defaultHomepage } from "discourse/lib/utilities";
|
||||
import Session from "discourse/models/session";
|
||||
import { Promise } from "rsvp";
|
||||
import Site from "discourse/models/site";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
// A helper to build a topic route for a filter
|
||||
function filterQueryParams(params, defaultParams) {
|
||||
@ -147,9 +148,26 @@ export default function(filter, extras) {
|
||||
);
|
||||
},
|
||||
|
||||
resetParams(controller) {
|
||||
controller.setProperties({
|
||||
order: "default",
|
||||
ascending: false,
|
||||
max_posts: null
|
||||
});
|
||||
},
|
||||
|
||||
@action
|
||||
willTransition() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.controller) {
|
||||
this.resetParams(this.controller);
|
||||
}
|
||||
},
|
||||
|
||||
resetController(controller, isExiting) {
|
||||
if (isExiting) {
|
||||
controller.setProperties({ order: "default", ascending: false });
|
||||
this.resetParams(controller);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user