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

(cherry picked from commit cd9ab89)
  • Loading branch information
luacmartins authored and OSBotify committed Dec 11, 2023
1 parent 99b9d0e commit 13cafaf
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 13cafaf

Please sign in to comment.