Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ function MoneyRequestParticipantsSelector({
if (newChatOptions.userToInvite && !OptionsListUtils.isCurrentUser(newChatOptions.userToInvite)) {
newSections.push({
undefined,
data: [newChatOptions.userToInvite],
data: _.map([newChatOptions.userToInvite], (participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, personalDetails);
}),
shouldShow: true,
indexOffset,
});
Expand Down Expand Up @@ -201,30 +204,8 @@ function MoneyRequestParticipantsSelector({
}

onAddParticipants(newSelectedOptions);

const chatOptions = OptionsListUtils.getFilteredOptions(
reports,
personalDetails,
betas,
isOptionInList ? searchTerm : '',
newSelectedOptions,
CONST.EXPENSIFY_EMAILS,

// If we are using this component in the "Request money" flow then we pass the includeOwnedWorkspaceChats argument so that the current user
// sees the option to request money from their admin on their own Workspace Chat.
iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST,

// We don't want to include any P2P options like personal details or reports that are not workspace chats for certain features.
!isDistanceRequest,
);

setNewChatOptions({
recentReports: chatOptions.recentReports,
personalDetails: chatOptions.personalDetails,
userToInvite: chatOptions.userToInvite,
});
},
[participants, onAddParticipants, reports, personalDetails, betas, searchTerm, iouType, isDistanceRequest],
[participants, onAddParticipants],
);

const headerMessage = OptionsListUtils.getHeaderMessage(
Expand Down