diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 9b30764b065d..e2d959ce4945 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -175,6 +175,7 @@ type GetOptionsConfig = { recentlyUsedPolicyReportFieldOptions?: string[]; transactionViolations?: OnyxCollection; includeInvoiceRooms?: boolean; + isSearchingForReports?: boolean; }; type GetUserToInviteConfig = { @@ -1749,6 +1750,7 @@ function getOptions( policyReportFieldOptions = [], recentlyUsedPolicyReportFieldOptions = [], includeInvoiceRooms = false, + isSearchingForReports = false, }: GetOptionsConfig, ): Options { if (includeCategories) { @@ -1831,6 +1833,7 @@ function getOptions( isInFocusMode: false, excludeEmptyChats: false, includeSelfDM, + isSearchingForReports }); }); @@ -2082,6 +2085,7 @@ function getSearchOptions(options: OptionList, searchValue = '', betas: Beta[] = includeMoneyRequests: true, includeTasks: true, includeSelfDM: true, + isSearchingForReports: true, }); Timing.end(CONST.TIMING.LOAD_SEARCH_OPTIONS); Performance.markEnd(CONST.TIMING.LOAD_SEARCH_OPTIONS); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 914c653b6f91..a65749a2fa1b 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5334,6 +5334,7 @@ function shouldReportBeInOptionList({ excludeEmptyChats, doesReportHaveViolations, includeSelfDM = false, + isSearchingForReports = false, }: { report: OnyxEntry; currentReportId: string; @@ -5343,6 +5344,7 @@ function shouldReportBeInOptionList({ excludeEmptyChats: boolean; doesReportHaveViolations: boolean; includeSelfDM?: boolean; + isSearchingForReports?: boolean; }) { const isInDefaultMode = !isInFocusMode; // Exclude reports that have no data because there wouldn't be anything to show in the option item. @@ -5370,7 +5372,8 @@ function shouldReportBeInOptionList({ !isSelfDM(report) && !isSystemChat(report) && !isGroupChat(report) && - !isInvoiceRoom(report)) + !isInvoiceRoom(report) && + (!isSearchingForReports && isDefaultRoom(report))) ) { return false; }