Skip to content

Commit

Permalink
fix(nav): issue group highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Sep 19, 2024
1 parent fc1ef18 commit 73773de
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions static/app/components/nav/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ export function getActiveStatus(
item: SidebarItem | SubmenuItem,
location: ReturnType<typeof useLocation>
): ActiveStatus {
if (hasMatchingQueryParam({to: item.to, label: item.label}, location))
return ActiveStatus.ACTIVE;
if (item.to.includes('/issues/') && item.to.includes('query=')) {
return hasMatchingQueryParam({to: item.to, label: item.label}, location)
? ActiveStatus.ACTIVE
: ActiveStatus.INACTIVE;
}
const normalizedTo = normalizeUrl(item.to);
const normalizedCurrent = normalizeUrl(location.pathname);
if (normalizedTo === normalizedCurrent) return ActiveStatus.ACTIVE;
Expand Down Expand Up @@ -119,7 +122,7 @@ export function hasMatchingQueryParam(
let match = false;
for (const key of itemQuery?.split(' ')) {
match = query.includes(key);
if (!match) break;
if (!match) continue;
}
return match;
}
Expand Down

0 comments on commit 73773de

Please sign in to comment.