From 11c04869e9d546100d60936d44b5a2601bb16102 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Tue, 26 Sep 2023 19:20:25 +0200 Subject: [PATCH 1/2] Fix Split Bill - Number keeps on changing its initials --- .../MoneyRequestParticipantsSelector.js | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index 170ee042bff..4b2eaf18359 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -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, }); @@ -201,28 +204,6 @@ 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], ); From 3b06da5cb56375c6de73bb6a1c509a485abf0813 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Tue, 26 Sep 2023 19:44:03 +0200 Subject: [PATCH 2/2] Update fix --- .../MoneyRequestParticipantsSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index 4b2eaf18359..05b206ce414 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -205,7 +205,7 @@ function MoneyRequestParticipantsSelector({ onAddParticipants(newSelectedOptions); }, - [participants, onAddParticipants, reports, personalDetails, betas, searchTerm, iouType, isDistanceRequest], + [participants, onAddParticipants], ); const headerMessage = OptionsListUtils.getHeaderMessage(