Skip to content

Commit

Permalink
Merge pull request #32847 from Expensify/cmartins-fixSelectedParticip…
Browse files Browse the repository at this point in the history
…ants

[CP Stag] Remove unnecessary chatOptions computation
  • Loading branch information
luacmartins authored Dec 11, 2023
2 parents 50e8a5c + 9d1f3b8 commit cd9ab89
Showing 1 changed file with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,30 +209,8 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
}

onParticipantsAdded(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.TYPE.REQUEST,

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

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

const headerMessage = OptionsListUtils.getHeaderMessage(
Expand Down Expand Up @@ -265,7 +243,10 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
false,
{},
[],
true,

// We don't want the user to be able to invite individuals when they are in the "Distance request" flow for now.
// This functionality is being built here: https://github.com/Expensify/App/issues/23291
iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE,
true,
);
setNewChatOptions({
Expand Down

0 comments on commit cd9ab89

Please sign in to comment.