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 9d5db9c commit a98c076Copy full SHA for a98c076
app/component/PrintableItinerary.js
@@ -378,16 +378,16 @@ class PrintableItinerary extends React.Component {
378
index={i}
379
originalLegs={originalLegs}
380
context={this.context}
381
- mapsLoaded={() => {
382
- const mapsLoaded = this.state.mapsLoaded + 1;
383
- this.setState({ mapsLoaded });
384
- if (
385
- mapsLoaded >=
386
- originalLegs.filter(o2 => o2.mode === 'WALK').length
387
- ) {
388
- setTimeout(() => window.print(), 1000);
389
- }
390
- }}
+ mapsLoaded={() =>
+ this.setState({ mapsLoaded: this.state.mapsLoaded + 1 }, () => {
+ if (
+ this.state.mapsLoaded >=
+ originalLegs.filter(o2 => o2.mode === 'WALK').length
+ ) {
+ setTimeout(() => window.print(), 1000);
+ }
+ })
391
/>
392
</div>
393
);
0 commit comments