@@ -27,7 +27,6 @@ import InlineSupportLink from 'calypso/components/inline-support-link';
27
27
import JetpackColophon from 'calypso/components/jetpack-colophon' ;
28
28
import NavigationHeader from 'calypso/components/navigation-header' ;
29
29
import StickyPanel from 'calypso/components/sticky-panel' ;
30
- import memoizeLast from 'calypso/lib/memoize-last' ;
31
30
import version_compare from 'calypso/lib/version-compare' ;
32
31
import Main from 'calypso/my-sites/stats/components/stats-main' ;
33
32
import {
@@ -95,14 +94,6 @@ const HIDDABLE_MODULES = AVAILABLE_PAGE_MODULES.traffic.map( ( module ) => {
95
94
return module . key ;
96
95
} ) ;
97
96
98
- const chartRangeToQuery = memoizeLast ( ( chartRange ) => ( {
99
- period : 'day' ,
100
- start_date : chartRange . chartStart ,
101
- date : chartRange . chartEnd ,
102
- summarize : 1 ,
103
- max : 10 ,
104
- } ) ) ;
105
-
106
97
const CHART_VIEWS = {
107
98
attr : 'views' ,
108
99
legendOptions : [ 'visitors' ] ,
@@ -504,7 +495,16 @@ function StatsBody( { siteId, chartTab = 'views', date, context, isInternal, ...
504
495
setActiveLegend ( period !== 'hour' ? newActiveTab . legendOptions || [ ] : [ ] ) ;
505
496
} , [ chartTab , period , activeTabState , context . query ] ) ;
506
497
507
- const query = chartRangeToQuery ( customChartRange ) ;
498
+ const query = useMemo (
499
+ ( ) => ( {
500
+ period : 'day' ,
501
+ start_date : customChartRange . chartStart ,
502
+ date : customChartRange . chartEnd ,
503
+ summarize : 1 ,
504
+ max : 10 ,
505
+ } ) ,
506
+ [ customChartRange . chartStart , customChartRange . chartEnd ]
507
+ ) ;
508
508
509
509
// For period option links
510
510
const traffic = {
0 commit comments