Skip to content

Commit

Permalink
change sort method with sortBy
Browse files Browse the repository at this point in the history
Signed-off-by: Tsaqif <[email protected]>
  • Loading branch information
tsa321 committed Oct 4, 2023
1 parent 0b3b3ec commit 74a840e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3072,7 +3072,7 @@ function shouldReportBeInOptionList(report, currentReportId, isInGSDMode, betas,
* @returns {Array|undefined}
*/
function getChatByParticipants(newParticipantList) {
newParticipantList.sort();
const sortedNewParticipantList = _.sortBy(newParticipantList);
return _.find(allReports, (report) => {
// If the report has been deleted, or there are no participants (like an empty #admins room) then skip it
if (
Expand All @@ -3088,7 +3088,7 @@ function getChatByParticipants(newParticipantList) {
}

// Only return the chat if it has all the participants
return _.isEqual(newParticipantList, _.sortBy(report.participantAccountIDs));
return _.isEqual(sortedNewParticipantList, _.sortBy(report.participantAccountIDs));
});
}

Expand Down

0 comments on commit 74a840e

Please sign in to comment.