fix: fix the trace explorer back navigation issue (#8760)

This commit is contained in:
Shaheer Kochai 2025-08-26 09:17:28 +04:30 committed by GitHub
parent 17533b2f1c
commit 88312e971d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,6 @@ import { QuickFiltersSource, SignalType } from 'components/QuickFilters/types';
import WarningPopover from 'components/WarningPopover/WarningPopover';
import { LOCALSTORAGE } from 'constants/localStorage';
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
import { QueryParams } from 'constants/query';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
import ExportPanel from 'container/ExportPanel';
@ -65,7 +64,7 @@ function TracesExplorer(): JSX.Element {
},
});
const [searchParams, setSearchParams] = useSearchParams();
const [searchParams] = useSearchParams();
// Get panel type from URL
const panelTypesFromUrl = useGetPanelTypesQueryParam(PANEL_TYPES.LIST);
@ -88,14 +87,6 @@ function TracesExplorer(): JSX.Element {
}
}, [panelTypesFromUrl, selectedView]);
// Update URL when selectedView changes
useEffect(() => {
setSearchParams((prev: URLSearchParams) => {
prev.set(QueryParams.selectedExplorerView, selectedView);
return prev;
});
}, [selectedView, setSearchParams]);
const [shouldReset, setShouldReset] = useState(false);
const [defaultQuery, setDefaultQuery] = useState<Query>(() =>
@ -141,6 +132,7 @@ function TracesExplorer(): JSX.Element {
}
setSelectedView(view);
handleExplorerTabChange(
view === ExplorerViews.TIMESERIES ? PANEL_TYPES.TIME_SERIES : view,
);