We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e958d4b commit 9d5db9cCopy full SHA for 9d5db9c
app/component/PrintableItinerary.js
@@ -379,11 +379,11 @@ class PrintableItinerary extends React.Component {
379
originalLegs={originalLegs}
380
context={this.context}
381
mapsLoaded={() => {
382
- this.setState({ mapsLoaded: this.state.mapsLoaded + 1 });
+ const mapsLoaded = this.state.mapsLoaded + 1;
383
+ this.setState({ mapsLoaded });
384
if (
- (this.state.mapsLoaded === 1 && originalLegs.length === 1) ||
385
- this.state.mapsLoaded + 1 ===
386
- originalLegs.filter(o2 => o2.mode === 'WALK').length
+ mapsLoaded >=
+ originalLegs.filter(o2 => o2.mode === 'WALK').length
387
) {
388
setTimeout(() => window.print(), 1000);
389
}
0 commit comments