Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
eaf693af
Verified
Commit
eaf693af
authored
2 years ago
by
Erwan Rouchet
Browse files
Options
Downloads
Patches
Plain Diff
Avoid causing a loop when going back after changing the page size
parent
eeb20745
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1444
Avoid causing a loop when going back after changing the page size
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Navigation/ElementNavigation.vue
+7
-9
7 additions, 9 deletions
src/components/Navigation/ElementNavigation.vue
with
7 additions
and
9 deletions
src/components/Navigation/ElementNavigation.vue
+
7
−
9
View file @
eaf693af
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment