@@ -37,10 +37,7 @@ import { GtfsVisualizationMap } from './GtfsVisualizationMap';
3737import ZoomOutMapIcon from '@mui/icons-material/ZoomOutMap' ;
3838import { useRemoteConfig } from '../context/RemoteConfigProvider' ;
3939import { sendGAEvent } from '@next/third-parties/google' ;
40- import {
41- selectGtfsDatasetRoutesLoadingStatus ,
42- selectGtfsDatasetRoutesTotal ,
43- } from '../store/supporting-files-selectors' ;
40+ import { selectGtfsDatasetRoutesLoadingStatus } from '../store/supporting-files-selectors' ;
4441import {
4542 getLatestGbfsVersion ,
4643 type LatestDatasetLite ,
@@ -60,6 +57,7 @@ interface CoveredAreaMapProps {
6057 boundingBox ?: LngLatTuple [ ] ;
6158 latestDataset ?: LatestDatasetLite ;
6259 feed : AllFeedType ;
60+ totalRoutes ?: number ;
6361}
6462
6563export const fetchGeoJson = async (
@@ -86,6 +84,7 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
8684 boundingBox,
8785 latestDataset,
8886 feed,
87+ totalRoutes,
8988} ) => {
9089 const t = useTranslations ( 'feeds' ) ;
9190 const tCommon = useTranslations ( 'common' ) ;
@@ -109,9 +108,7 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
109108 const routesJsonLoadingStatus = useSelector (
110109 selectGtfsDatasetRoutesLoadingStatus ,
111110 ) ;
112- const routesTotal = useSelector ( selectGtfsDatasetRoutesTotal ) ;
113- const hasNoRoutes =
114- routesJsonLoadingStatus === 'loaded' && routesTotal === 0 ;
111+ const hasNoRoutes = totalRoutes !== undefined && totalRoutes === 0 ;
115112
116113 const getAndSetGeoJsonData = ( urlToExtract : string ) : void => {
117114 setGeoJsonLoading ( true ) ;
@@ -187,7 +184,7 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
187184 return ;
188185 }
189186 setView ( 'boundingBoxView' ) ;
190- } , [ feed , routesJsonLoadingStatus , routesTotal , boundingBox , geoJsonData ] ) ;
187+ } , [ feed , routesJsonLoadingStatus , totalRoutes , boundingBox , geoJsonData ] ) ;
191188
192189 const handleViewChange = (
193190 _ : React . MouseEvent < HTMLElement > ,
0 commit comments