Skip to content

Commit f07eb7c

Browse files
committed
Replace useRouter usage in CustomerStats
1 parent 7d8fe40 commit f07eb7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

static/gsAdmin/components/customers/customerStats.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {defined} from 'sentry/utils';
2222
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
2323
import {getDynamicText} from 'sentry/utils/getDynamicText';
2424
import {useApiQuery} from 'sentry/utils/queryClient';
25-
import {useRouter} from 'sentry/utils/useRouter';
25+
import {useLocation} from 'sentry/utils/useLocation';
2626

2727
enum SeriesName {
2828
ACCEPTED = 'Accepted',
@@ -434,15 +434,15 @@ type Props = {
434434

435435
export const CustomerStats = memo(
436436
({orgSlug, projectId, dataType, onDemandPeriodStart, onDemandPeriodEnd}: Props) => {
437-
const router = useRouter();
437+
const location = useLocation();
438438

439439
const dataDatetime = useMemo((): DateTimeObject => {
440440
const {
441441
start,
442442
end,
443443
utc: utcString,
444444
statsPeriod,
445-
} = normalizeDateTimeParams(router.location.query, {
445+
} = normalizeDateTimeParams(location.query, {
446446
allowEmptyPeriod: true,
447447
allowAbsoluteDatetime: true,
448448
allowAbsolutePageDatetime: true,
@@ -474,7 +474,7 @@ export const CustomerStats = memo(
474474
return {
475475
period: statsPeriod ?? '90d',
476476
};
477-
}, [router.location.query, onDemandPeriodStart, onDemandPeriodEnd]);
477+
}, [location.query, onDemandPeriodStart, onDemandPeriodEnd]);
478478

479479
const statsEndpointUrl = getApiUrl(`/organizations/$organizationIdOrSlug/stats_v2/`, {
480480
path: {organizationIdOrSlug: orgSlug},

0 commit comments

Comments
 (0)