From 99e892b31a9fbae45a781ea264fb0a9e7cc97e99 Mon Sep 17 00:00:00 2001 From: MichaelSun48 Date: Fri, 20 Sep 2024 14:15:39 -0700 Subject: [PATCH] Don't overwrite project or env if present in search params --- static/app/views/issueList/customViewsHeader.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/app/views/issueList/customViewsHeader.tsx b/static/app/views/issueList/customViewsHeader.tsx index 0de5d4f7dbf5bf..3fd9088d83c6ed 100644 --- a/static/app/views/issueList/customViewsHeader.tsx +++ b/static/app/views/issueList/customViewsHeader.tsx @@ -126,15 +126,15 @@ function CustomViewsIssueListHeaderTabsContent({ // TODO(msun): Use the location from useLocation instead of props router in the future const {cursor: _cursor, page: _page, ...queryParams} = router?.location.query; + const {query, sort, viewId, project, environment} = queryParams; + const queryParamsWithPageFilters = { ...queryParams, - project: pageFilters.selection.projects, - environment: pageFilters.selection.environments, + project: project ?? pageFilters.selection.projects, + environment: environment ?? pageFilters.selection.environments, ...normalizeDateTimeParams(pageFilters.selection.datetime), }; - const {query, sort, viewId} = queryParams; - const viewsToTabs = views.map( ({id, name, query: viewQuery, querySort: viewQuerySort}, index): Tab => { const tabId = id ?? `default${index.toString()}`;