Skip to content

Commit

Permalink
Simplified updateWaypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
alitoshmatov committed Oct 17, 2023
1 parent a88728a commit 19c8e25
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/DistanceRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, {useCallback, useEffect, useMemo, useState, useRef} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import lodashGet from 'lodash/get';
import lodashIsEmpty from 'lodash/isEmpty';
import PropTypes from 'prop-types';
import _ from 'underscore';
import ROUTES from '../../ROUTES';
Expand Down Expand Up @@ -169,8 +168,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe

const newWaypoints = {};
_.each(data, (waypoint, index) => {
const newWaypoint = lodashGet(waypoints, waypoint, {});
newWaypoints[`waypoint${index}`] = lodashIsEmpty(newWaypoint) ? {} : newWaypoint;
newWaypoints[`waypoint${index}`] = lodashGet(waypoints, waypoint, {});
});

setOptimisticWaypoints(newWaypoints);
Expand Down

0 comments on commit 19c8e25

Please sign in to comment.