From 0b10d76c204c0c0943ceeaf7511db971f502d1ac Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Thu, 11 Oct 2018 17:26:19 +0100 Subject: [PATCH] changed directions to walking / public transport --- server/reducers/directions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/reducers/directions.js b/server/reducers/directions.js index a56ad6c..b56505e 100644 --- a/server/reducers/directions.js +++ b/server/reducers/directions.js @@ -22,7 +22,7 @@ function reduceEstDirections(body = '') { obj.totalTime = parseFloat(get(directions, 'total_time')); obj.totalTimeWithTraffic = parseFloat(get(directions, 'total_time_with_traffic')); - obj.readable = humanizeDuration(obj.totalTimeWithTraffic * 60 * 1000); + obj.readable = humanizeDuration((obj.totalTimeWithTraffic !== 0 ? obj.totalTimeWithTraffic : obj.totalTime) * 60 * 1000); obj.timePercentage = ((obj.totalTime * ( obj.totalTimeWithTraffic / 100 )) + obj.totalTime) - 100;