Skip to content

Commit

Permalink
improve property lookup with lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
Julesssss committed Mar 7, 2023
1 parent 2c37fe3 commit b1dd65d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/ReportActionsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ function getSortedReportActions(reportActions, shouldSortInDescendingOrder = fal
* @returns {String}
*/
function getMostRecentIOURequestActionID(reportActions) {
const iouRequestActions = _.filter(reportActions, action => action.originalMessage
&& action.originalMessage.type && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE);
const iouRequestActions = _.filter(reportActions, action => lodashGet(action, 'originalMessage.type') === CONST.IOU.REPORT_ACTION_TYPE.CREATE);

if (_.isEmpty(iouRequestActions)) {
return null;
Expand Down

0 comments on commit b1dd65d

Please sign in to comment.