Skip to content

Commit

Permalink
Search Earlier routes with 'Arrive By' option now works correctly
Browse files Browse the repository at this point in the history
Correct logic was skipped this way:
  if(true == 'true') {
    // do the right thing
  }

Also, clear the spinner correctly
  • Loading branch information
vesameskanen committed Jun 14, 2018
1 parent 0e07067 commit 4a8c134
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/component/SummaryPlanContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class SummaryPlanContainer extends React.Component {
};

onEarlier = () => {
this.props.setLoading(true);
const start = moment.unix(this.props.serviceTimeRange.start);

const earliestArrivalTime = this.props.itineraries.reduce(
Expand All @@ -184,7 +183,7 @@ class SummaryPlanContainer extends React.Component {

earliestArrivalTime.subtract(1, 'minutes');

if (this.context.location.query.arriveBy === true) {
if (this.context.location.query.arriveBy === 'true') {
// user has arriveBy already
this.context.router.replace({
...this.context.location,
Expand All @@ -194,6 +193,8 @@ class SummaryPlanContainer extends React.Component {
},
});
} else {
this.props.setLoading(true);

const params = preparePlanParams(this.props.config)(
this.context.router.params,
this.context,
Expand Down

0 comments on commit 4a8c134

Please sign in to comment.