From 73773dea3e32fb10371038e7191b305c14e64ae9 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 19 Sep 2024 17:12:06 -0500 Subject: [PATCH] fix(nav): issue group highlighting --- static/app/components/nav/utils.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/app/components/nav/utils.tsx b/static/app/components/nav/utils.tsx index 647fd6d2120d58..034152fac3bbf9 100644 --- a/static/app/components/nav/utils.tsx +++ b/static/app/components/nav/utils.tsx @@ -69,8 +69,11 @@ export function getActiveStatus( item: SidebarItem | SubmenuItem, location: ReturnType ): 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; @@ -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; }