From 53d9adfd561e291ec9830e45d2cbae8f3ae0aac8 Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Mon, 19 Mar 2018 19:59:44 -0700 Subject: Refs #6248 Get journey pattern total distance and kms in first render --- app/javascript/journey_patterns/components/JourneyPattern.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/javascript/journey_patterns/components/JourneyPattern.js b/app/javascript/journey_patterns/components/JourneyPattern.js index 15d8b6db4..00b5497f7 100644 --- a/app/javascript/journey_patterns/components/JourneyPattern.js +++ b/app/javascript/journey_patterns/components/JourneyPattern.js @@ -80,7 +80,6 @@ export default class JourneyPattern extends Component{ let from = null this.props.value.stop_points.map((stopPoint, i) =>{ let usePoint = stopPoint.checked - console.log(stopPoint) if(onlyCommercial && (i == 0 || i == this.props.value.stop_points.length - 1) && stopPoint.kind == "non_commercial"){ usePoint = false } @@ -131,12 +130,9 @@ export default class JourneyPattern extends Component{ } } - componentWillUpdate() { - [this.totalTime, this.totalDistance] = this.totals(false) - } - render() { this.previousSpId = undefined + let [totalTime, totalDistance] = this.totals(false) let [commercialTotalTime, commercialTotalDistance] = this.totals(true) return (