Skip to content

Commit

Permalink
rename variable for better clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
c3024 committed Sep 26, 2024
1 parent 46840cd commit b76fb45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ function orderOptions(
if (option.isSelfDM) {
return 0;
}
if (preferRecentExpenseReports && !!option?.lastIOUTime) {
if (preferRecentExpenseReports && !!option?.lastIOUCreationDate) {
return 1;
}
if (preferRecentExpenseReports && option.isPolicyExpenseChat) {
Expand All @@ -1610,8 +1610,8 @@ function orderOptions(
// When option.login is an exact match with the search value, returning 0 puts it at the top of the option list
return 0;
},
// For Submit Expense flow, prioritze the most recent expense reports and then policy expense chats (without expense requests)
preferRecentExpenseReports ? (option) => option?.lastIOUTime ?? '' : '',
// For Submit Expense flow, prioritize the most recent expense reports and then policy expense chats (without expense requests)
preferRecentExpenseReports ? (option) => option?.lastIOUCreationDate ?? '' : '',
preferRecentExpenseReports ? (option) => option?.isPolicyExpenseChat : 0,
],
['asc', 'desc', 'desc'],
Expand Down Expand Up @@ -2006,7 +2006,7 @@ function getOptions(
const iouReportActions = allSortedReportActions[iouReportID] ?? [];
const lastIOUAction = iouReportActions.find((iouAction) => iouAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU);
if (lastIOUAction) {
reportOption.lastIOUTime = lastIOUAction.lastModified;
reportOption.lastIOUCreationDate = lastIOUAction.lastModified;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ type OptionData = {
tabIndex?: 0 | -1;
isConciergeChat?: boolean;
isBold?: boolean;
lastIOUTime?: string;
lastIOUCreationDate?: string;
} & Report;

type OnyxDataTaskAssigneeChat = {
Expand Down

0 comments on commit b76fb45

Please sign in to comment.