File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/libs/TransactionUtils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import lodashSet from 'lodash/set';
66import type { OnyxCollection , OnyxEntry } from 'react-native-onyx' ;
77import Onyx from 'react-native-onyx' ;
88import type { ValueOf } from 'type-fest' ;
9+ import type { Coordinate } from '@components/MapView/MapViewTypes' ;
10+ import utils from '@components/MapView/utils' ;
911import type { UnreportedExpenseListItemType } from '@components/SelectionListWithSections/types' ;
1012import { getPolicyTagsData } from '@libs/actions/Policy/Tag' ;
1113import type { MergeDuplicatesParams } from '@libs/API/parameters' ;
@@ -1359,8 +1361,10 @@ function getValidWaypoints(waypoints: WaypointCollection | undefined, reArrangeI
13591361 return acc ;
13601362 }
13611363
1362- // Check for adjacent waypoints with the same address
1363- if ( previousWaypoint && currentWaypoint ?. address === previousWaypoint . address ) {
1364+ // Check for adjacent waypoints with the same address or coordinate
1365+ const previousCoordinate : Coordinate = [ previousWaypoint ?. lng ?? 0 , previousWaypoint ?. lat ?? 0 ] ;
1366+ const currentCoordinate : Coordinate = [ currentWaypoint . lng ?? 0 , currentWaypoint . lat ?? 0 ] ;
1367+ if ( previousWaypoint && ( currentWaypoint ?. address === previousWaypoint . address || utils . areSameCoordinate ( previousCoordinate , currentCoordinate ) ) ) {
13641368 return acc ;
13651369 }
13661370
You can’t perform that action at this time.
0 commit comments