Skip to content

Commit

Permalink
add optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed May 23, 2024
1 parent e8ae3c5 commit f7f3e71
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function PolicyDistanceRateDetailsPage({policy, route}: PolicyDistanceRateDetail
const currency = rate?.currency ?? CONST.CURRENCY.USD;

// Rates can be disabled or deleted as long as in the remaining rates there is always at least one enabled rate and there are no pending delete action
const canDisableOrDeleteRate = Object.values(customUnit?.rates).some(
const canDisableOrDeleteRate = Object.values(customUnit?.rates ?? {}).some(
(distanceRate: Rate) => distanceRate?.enabled && rateID !== distanceRate?.customUnitRateID && distanceRate?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
const errorFields = rate?.errorFields;
Expand Down

0 comments on commit f7f3e71

Please sign in to comment.