From 0d377e06d3e1f2072a77bd2468455472a464cd9b Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Fri, 2 Aug 2024 20:15:58 +0300 Subject: [PATCH] Don't display add stop button when existing way points are less than 2 --- src/components/DistanceRequest/DistanceRequestFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DistanceRequest/DistanceRequestFooter.tsx b/src/components/DistanceRequest/DistanceRequestFooter.tsx index e21bdc1c9e56..43dd88f6e36c 100644 --- a/src/components/DistanceRequest/DistanceRequestFooter.tsx +++ b/src/components/DistanceRequest/DistanceRequestFooter.tsx @@ -43,7 +43,7 @@ function DistanceRequestFooter({waypoints, transaction, mapboxAccessToken, navig const {translate} = useLocalize(); const numberOfWaypoints = Object.keys(waypoints ?? {}).length; - const numberOfFilledWaypoints = Object.values(waypoints ?? {}).filter((waypoint) => Object.keys(waypoint).length).length; + const numberOfFilledWaypoints = Object.values(waypoints ?? {}).filter((waypoint) => waypoint?.address).length; const lastWaypointIndex = numberOfWaypoints - 1; const getMarkerComponent = useCallback(