diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 611f44f751db..a8edd8636202 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -594,6 +594,7 @@ function getOptions( includeOwnedWorkspaceChats = false, includeThreads = false, includeTasks = false, + includeMoneyRequests = false, }, ) { if (!isPersonalDetailsReady(personalDetails)) { @@ -644,6 +645,7 @@ function getOptions( const isChatRoom = ReportUtils.isChatRoom(report); const isTaskReport = ReportUtils.isTaskReport(report); const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report); + const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const accountIDs = report.participantAccountIDs || []; if (isPolicyExpenseChat && report.isOwnPolicyExpenseChat && !includeOwnedWorkspaceChats) { @@ -658,6 +660,10 @@ function getOptions( return; } + if (isMoneyRequestReport && !includeMoneyRequests) { + return; + } + // Save the report in the map if this is a single participant so we can associate the reportID with the // personal detail option later. Individuals should not be associated with single participant // policyExpenseChats or chatRooms since those are not people. @@ -853,6 +859,7 @@ function getSearchOptions(reports, personalDetails, searchValue = '', betas) { forcePolicyNamePreview: true, includeOwnedWorkspaceChats: true, includeThreads: true, + includeMoneyRequests: true, }); } @@ -935,9 +942,7 @@ function getNewChatOptions(reports, personalDetails, betas = [], searchValue = ' */ function getShareDestinationOptions(reports, personalDetails, betas = [], searchValue = '', selectedOptions = [], excludeLogins = [], includeOwnedWorkspaceChats = true) { - // We want to filter out any IOUs or expense reports - const filteredReports = _.filter(reports, (report) => !ReportUtils.isMoneyRequestReport(report)); - return getOptions(filteredReports, personalDetails, { + return getOptions(reports, personalDetails, { betas, searchInputValue: searchValue.trim(), selectedOptions,