Skip to content
Snippets Groups Projects
Verified Commit eaf693af authored by Erwan Rouchet's avatar Erwan Rouchet
Browse files

Avoid causing a loop when going back after changing the page size

parent eeb20745
No related branches found
No related tags found
1 merge request!1444Avoid causing a loop when going back after changing the page size
......@@ -209,16 +209,14 @@ export default {
// Clone the query to avoid mutating the original argument
const newQuery = { ...query }
// If the store did not yet have a page size and there is one in the URL, store it there, or set to the default size
if (this.navigationPageSize === null) {
let pageSize = DEFAULT_PAGE_SIZE
if (query.page_size) {
pageSize = Number.parseInt(query.page_size, 10)
// Reject invalid page sizes
if (!NAVIGATION_PAGE_SIZES.includes(pageSize)) pageSize = DEFAULT_PAGE_SIZE
}
this.setPageSize(pageSize)
// If there is a page size in the URL, store it, otherwise reset to the default size
let pageSize = DEFAULT_PAGE_SIZE
if (query.page_size) {
pageSize = Number.parseInt(query.page_size, 10)
// Reject invalid page sizes
if (!NAVIGATION_PAGE_SIZES.includes(pageSize)) pageSize = DEFAULT_PAGE_SIZE
}
if (this.navigationPageSize !== pageSize) this.setPageSize(pageSize)
if (query.page_size) delete newQuery.page_size
if (query.page) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment