Skip to content

Commit

Permalink
ref(browserHistory): Remove from regressedProfileFunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Dec 27, 2024
1 parent be0f4da commit 153d6d4
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {Organization} from 'sentry/types/organization';
import type {Project} from 'sentry/types/project';
import {defined} from 'sentry/utils';
import {trackAnalytics} from 'sentry/utils/analytics';
import {browserHistory} from 'sentry/utils/browserHistory';
import {formatPercentage} from 'sentry/utils/number/formatPercentage';
import type {FunctionTrend, TrendType} from 'sentry/utils/profiling/hooks/types';
import {useCurrentProjectFromRouteParam} from 'sentry/utils/profiling/hooks/useCurrentProjectFromRouteParam';
Expand All @@ -28,6 +27,7 @@ import {relativeChange} from 'sentry/utils/profiling/units/units';
import {decodeScalar} from 'sentry/utils/queryString';
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
import {useLocation} from 'sentry/utils/useLocation';
import {useNavigate} from 'sentry/utils/useNavigate';
import useOrganization from 'sentry/utils/useOrganization';

import {ProfilingSparklineChart} from './profilingSparklineChart';
Expand Down Expand Up @@ -124,6 +124,7 @@ interface MostRegressedProfileFunctionsProps {
export function MostRegressedProfileFunctions(props: MostRegressedProfileFunctionsProps) {
const organization = useOrganization();
const project = useCurrentProjectFromRouteParam();
const navigate = useNavigate();
const location = useLocation();
const theme = useTheme();

Expand All @@ -132,12 +133,15 @@ export function MostRegressedProfileFunctions(props: MostRegressedProfileFunctio
[location.query]
);

const handleRegressedFunctionsCursor = useCallback((cursor, pathname, query) => {
browserHistory.push({
pathname,
query: {...query, [REGRESSED_FUNCTIONS_CURSOR]: cursor},
});
}, []);
const handleRegressedFunctionsCursor = useCallback(
(cursor, pathname, query) => {
navigate({
pathname,
query: {...query, [REGRESSED_FUNCTIONS_CURSOR]: cursor},
});
},
[navigate]
);

const functionQuery = useMemo(() => {
const conditions = new MutableSearch('');
Expand Down

0 comments on commit 153d6d4

Please sign in to comment.