Skip to content

Commit

Permalink
Fix Split Bill - Number keeps on changing its initials
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Sep 26, 2023
1 parent cfad43f commit 11c0486
Showing 1 changed file with 4 additions and 23 deletions.
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,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],

Check warning on line 208 in src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js

View workflow job for this annotation

GitHub Actions / lint

React Hook useCallback has unnecessary dependencies: 'betas', 'iouType', 'isDistanceRequest', 'personalDetails', 'reports', and 'searchTerm'. Either exclude them or remove the dependency array
);
Expand Down

0 comments on commit 11c0486

Please sign in to comment.