From 13cafaf8461ae5bc052a66a3befc6d803265137c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 11 Dec 2023 12:06:33 -0700 Subject: [PATCH] Merge pull request #32847 from Expensify/cmartins-fixSelectedParticipants [CP Stag] Remove unnecessary chatOptions computation (cherry picked from commit cd9ab89c8343e20ed20b1f82fb08fab1363ff6ac) --- ...yForRefactorRequestParticipantsSelector.js | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js b/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js index 165852062c54..95fa64723737 100644 --- a/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js +++ b/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js @@ -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( @@ -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({