mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Fix UI bug where inherited_page=0
would be incorrectly added to some URLs (#11971)
This commit is contained in:
parent
3d478614fb
commit
5662d2cdcc
1
changes/bugfix-inherited-page-param
Normal file
1
changes/bugfix-inherited-page-param
Normal file
@ -0,0 +1 @@
|
||||
- Fixed UI bug where `inherited_page=0` was incorrectly added to some URLs
|
@ -36,15 +36,11 @@ const rebuildQueryStringWithTeamId = (
|
||||
const inheritedPageIndex = parts.findIndex((p) =>
|
||||
p.startsWith("inherited_page=")
|
||||
);
|
||||
|
||||
const newPagePart = "page=0";
|
||||
const newInheritedPagePart = "inherited_page=0";
|
||||
|
||||
if (pageIndex) {
|
||||
parts.splice(pageIndex, 1, newPagePart);
|
||||
if (pageIndex !== -1) {
|
||||
parts.splice(pageIndex, 1, "page=0");
|
||||
}
|
||||
if (inheritedPageIndex) {
|
||||
parts.splice(inheritedPageIndex, 1, newInheritedPagePart);
|
||||
if (inheritedPageIndex !== -1) {
|
||||
parts.splice(inheritedPageIndex, 1, "inherited_page=0");
|
||||
}
|
||||
|
||||
const teamIndex = parts.findIndex((p) => p.startsWith("team_id="));
|
||||
@ -52,7 +48,7 @@ const rebuildQueryStringWithTeamId = (
|
||||
const newTeamPart =
|
||||
newTeamId > APP_CONTEXT_ALL_TEAMS_ID ? `team_id=${newTeamId}` : "";
|
||||
|
||||
if (teamIndex < 0) {
|
||||
if (teamIndex === -1) {
|
||||
// nothing to remove/replace so add the new part (if any) and rejoin
|
||||
return joinQueryStringParts(
|
||||
newTeamPart ? parts.concat(newTeamPart) : parts
|
||||
|
Loading…
Reference in New Issue
Block a user