@@ -31,7 +31,7 @@ export default function OpenDataImportModal(props) {
31
31
const rollingStockID = useSelector ( getRollingStockID ) ;
32
32
const timetableID = useSelector ( getTimetableID ) ;
33
33
34
- const [ trainsWithPathRef , setTrainsWithPathRef ] = useState ( ) ;
34
+ const [ trainsWithPathRef , setTrainsWithPathRef ] = useState ( [ ] ) ;
35
35
36
36
// Places, points, OPs to add track section id
37
37
const [ pointsDictionnary , setPointsDictionnary ] = useState ( ) ;
@@ -244,7 +244,7 @@ export default function OpenDataImportModal(props) {
244
244
245
245
return (
246
246
< ModalSNCF htmlID = "OpenDataImportModal" >
247
- { pathsDictionnary && trainsWithPathRef ? (
247
+ { pathsDictionnary && trainsWithPathRef . length > 0 ? (
248
248
< ModalBodySNCF >
249
249
{ ! infraID || ! timetableID || ! rollingStockID ? null : (
250
250
< >
@@ -316,8 +316,12 @@ export default function OpenDataImportModal(props) {
316
316
) ;
317
317
}
318
318
319
+ OpenDataImportModal . defaultProps = {
320
+ rollingStockDB : [ ] ,
321
+ } ;
322
+
319
323
OpenDataImportModal . propTypes = {
320
324
trains : PropTypes . array . isRequired ,
321
- rollingStockDB : PropTypes . array . isRequired ,
325
+ rollingStockDB : PropTypes . array ,
322
326
setMustUpdateTimetable : PropTypes . func . isRequired ,
323
327
} ;
0 commit comments