From 74a840e06d61e3ba4ec9fb9c903f87699ab29e4d Mon Sep 17 00:00:00 2001 From: Tsaqif Date: Thu, 5 Oct 2023 06:29:33 +0700 Subject: [PATCH] change sort method with sortBy Signed-off-by: Tsaqif --- src/libs/ReportUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 647af48c6039..1a87b7135a8f 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -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 ( @@ -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)); }); }