File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,10 @@ function TransferMap(props) {
128128 const previousLeg = props . originalLegs [ props . index - 1 ] ;
129129
130130 let itineraryLine ;
131- if ( ! nextLeg ) {
132- itineraryLine = [ previousLeg , props . legObj ] ;
133- } else if ( nextLeg && nextLeg . intermediatePlace ) {
131+ if ( ( ! previousLeg && ! nextLeg ) || ( nextLeg && nextLeg . intermediatePlace ) ) {
134132 itineraryLine = [ props . legObj ] ;
133+ } else if ( ! nextLeg ) {
134+ itineraryLine = [ previousLeg , props . legObj ] ;
135135 } else {
136136 itineraryLine = [ props . legObj , nextLeg ] ;
137137 }
@@ -378,15 +378,16 @@ class PrintableItinerary extends React.Component {
378378 index = { i }
379379 originalLegs = { originalLegs }
380380 context = { this . context }
381- mapsLoaded = { ( ) => {
382- this . setState ( { mapsLoaded : this . state . mapsLoaded + 1 } ) ;
383- if (
384- this . state . mapsLoaded + 1 ===
385- originalLegs . filter ( o2 => o2 . mode === 'WALK' ) . length
386- ) {
387- setTimeout ( ( ) => window . print ( ) , 1000 ) ;
388- }
389- } }
381+ mapsLoaded = { ( ) =>
382+ this . setState ( { mapsLoaded : this . state . mapsLoaded + 1 } , ( ) => {
383+ if (
384+ this . state . mapsLoaded >=
385+ originalLegs . filter ( o2 => o2 . mode === 'WALK' ) . length
386+ ) {
387+ setTimeout ( ( ) => window . print ( ) , 1000 ) ;
388+ }
389+ } )
390+ }
390391 />
391392 </ div >
392393 ) ;
You can’t perform that action at this time.
0 commit comments