diff --git a/assets/js/dashboard/stats/locations/index.js b/assets/js/dashboard/stats/locations/index.js index 216cf37e4..31b3cc0cb 100644 --- a/assets/js/dashboard/stats/locations/index.js +++ b/assets/js/dashboard/stats/locations/index.js @@ -34,7 +34,7 @@ function Countries({query, site, onClick}) { function Regions({query, site, onClick}) { function fetchData() { - return api.get(apiPath(site, '/regions'), query, {country_name: query.filters.country, limit: 9}) + return api.get(apiPath(site, '/regions'), query, {limit: 9}) } function renderIcon(region) { diff --git a/assets/js/dashboard/stats/reports/list.js b/assets/js/dashboard/stats/reports/list.js index 4888a1d48..767fba1fd 100644 --- a/assets/js/dashboard/stats/reports/list.js +++ b/assets/js/dashboard/stats/reports/list.js @@ -30,11 +30,11 @@ export default function ListReport(props) { const [state, setState] = useState({loading: true, list: null}) const valueKey = props.valueKey || 'visitors' const showConversionRate = !!props.query.filters.goal - const prevProps = useRef(); + const prevQuery = useRef(); function fetchData() { - if (typeof(prevProps.current) === 'undefined' || prevProps.current !== props) { - prevProps.current = props; + if (typeof(prevQuery.current) === 'undefined' || prevQuery.current !== props.query) { + prevQuery.current = props.query; setState({loading: true, list: null}) props.fetchData() .then((res) => setState({loading: false, list: res}))