Skip to content

Commit

Permalink
Merge pull request #34587 from lukemorawski/20354-fix_money_request_p…
Browse files Browse the repository at this point in the history
…articipants_selector_list_header

[CP Staging] Fix App crash when selecting more than 5 participants
  • Loading branch information
mountiny authored Jan 16, 2024
2 parents f7e815f + cfc87a0 commit 045ae0d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
indexOffset = formatResults.newIndexOffset;

if (maxParticipantsReached) {
return newSections;
return [newSections, {}];
}

newSections.push({
Expand Down Expand Up @@ -229,13 +229,13 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
const headerMessage = useMemo(
() =>
OptionsListUtils.getHeaderMessage(
newChatOptions.personalDetails.length + newChatOptions.recentReports.length !== 0,
_.get(newChatOptions, 'personalDetails.length', 0) + _.get(newChatOptions, 'recentReports.length', 0) !== 0,
Boolean(newChatOptions.userToInvite),
searchTerm.trim(),
maxParticipantsReached,
_.some(participants, (participant) => participant.searchText.toLowerCase().includes(searchTerm.trim().toLowerCase())),
),
[maxParticipantsReached, newChatOptions.personalDetails.length, newChatOptions.recentReports.length, newChatOptions.userToInvite, participants, searchTerm],
[maxParticipantsReached, newChatOptions, participants, searchTerm],
);

// When search term updates we will fetch any reports
Expand Down

0 comments on commit 045ae0d

Please sign in to comment.