From 1a27ee73e5af475e44a9d04a1cd5780136c61241 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 10 Apr 2024 17:05:39 +0100 Subject: [PATCH] Merge pull request #40019 from Expensify/revert-38887-enable-searching-for-workspaces-by-participants [CP Staging] Revert "Enable searching for workspaces/rooms by their participants" (cherry picked from commit e3d68f5668c801a2858cf4be573fb83da2ad8cbd) --- src/libs/OptionsListUtils.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index e1a3e9207ad8..a938b9cc4f0c 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -447,19 +447,20 @@ function getSearchText( ): string { let searchTerms: string[] = []; - for (const personalDetail of personalDetailList) { - if (personalDetail.login) { - // The regex below is used to remove dots only from the local part of the user email (local-part@domain) - // so that we can match emails that have dots without explicitly writing the dots (e.g: fistlast@domain will match first.last@domain) - // More info https://github.com/Expensify/App/issues/8007 - searchTerms = searchTerms.concat([ - PersonalDetailsUtils.getDisplayNameOrDefault(personalDetail, '', false), - personalDetail.login, - personalDetail.login.replace(/\.(?=[^\s@]*@)/g, ''), - ]); + if (!isChatRoomOrPolicyExpenseChat) { + for (const personalDetail of personalDetailList) { + if (personalDetail.login) { + // The regex below is used to remove dots only from the local part of the user email (local-part@domain) + // so that we can match emails that have dots without explicitly writing the dots (e.g: fistlast@domain will match first.last@domain) + // More info https://github.com/Expensify/App/issues/8007 + searchTerms = searchTerms.concat([ + PersonalDetailsUtils.getDisplayNameOrDefault(personalDetail, '', false), + personalDetail.login, + personalDetail.login.replace(/\.(?=[^\s@]*@)/g, ''), + ]); + } } } - if (report) { Array.prototype.push.apply(searchTerms, reportName.split(/[,\s]/));