1- import { Fragment , useEffect , useMemo } from 'react' ;
1+ import { Fragment , useMemo } from 'react' ;
22import styled from '@emotion/styled' ;
33
44import { getSeriesApiInterval } from 'sentry/components/charts/utils' ;
@@ -10,8 +10,7 @@ import type {DataCategoryInfo} from 'sentry/types/core';
1010import type { Project } from 'sentry/types/project' ;
1111import { defined } from 'sentry/utils' ;
1212import { useApiQuery } from 'sentry/utils/queryClient' ;
13- import type { WithRouteAnalyticsProps } from 'sentry/utils/routeAnalytics/withRouteAnalytics' ;
14- import withRouteAnalytics from 'sentry/utils/routeAnalytics/withRouteAnalytics' ;
13+ import useRouteAnalyticsParams from 'sentry/utils/routeAnalytics/useRouteAnalyticsParams' ;
1514import { useNavigate } from 'sentry/utils/useNavigate' ;
1615import withProjects from 'sentry/utils/withProjects' ;
1716import type { UsageSeries } from 'sentry/views/organizationStats/types' ;
@@ -204,9 +203,7 @@ function getSpikeDetails({
204203 return actualSpikes ;
205204}
206205
207- interface EnhancedUsageStatsOrganizationProps
208- extends WithRouteAnalyticsProps ,
209- UsageStatsOrganizationProps {
206+ interface EnhancedUsageStatsOrganizationProps extends UsageStatsOrganizationProps {
210207 isSingleProject : boolean ;
211208 projects : Project [ ] ;
212209 subscription : Subscription ;
@@ -229,7 +226,6 @@ function EnhancedUsageStatsOrganization({
229226 dataCategory,
230227 dataCategoryName,
231228 dataCategoryApiName,
232- setRouteAnalyticsParams,
233229 isSingleProject,
234230 spikeCursor,
235231 clientDiscard,
@@ -305,20 +301,12 @@ function EnhancedUsageStatsOrganization({
305301 { staleTime : Infinity , retry : false , enabled : spikeThresholdsQueryEnabled }
306302 ) ;
307303
308- useEffect ( ( ) => {
309- setRouteAnalyticsParams ( {
310- subscription,
311- organization,
312- is_project_stats : isSingleProject ,
313- has_spike_data : isSingleProject && hasAccurateSpikes ,
314- } ) ;
315- } , [
316- hasAccurateSpikes ,
317- isSingleProject ,
318- organization ,
319- setRouteAnalyticsParams ,
304+ useRouteAnalyticsParams ( {
320305 subscription,
321- ] ) ;
306+ organization,
307+ is_project_stats : isSingleProject ,
308+ has_spike_data : isSingleProject && hasAccurateSpikes ,
309+ } ) ;
322310
323311 const newEndpointQuery = useMemo ( ( ) => {
324312 const query = endpointQuery ;
@@ -496,6 +484,4 @@ const DroppedFromSpikesStat = styled('div')`
496484 font-size: ${ p => p . theme . fontSize . md } ;
497485` ;
498486
499- export default withRouteAnalytics (
500- withProjects ( withSubscription ( EnhancedUsageStatsOrganization ) )
501- ) ;
487+ export default withProjects ( withSubscription ( EnhancedUsageStatsOrganization ) ) ;
0 commit comments