From b28271f678a9d019cc1dd3efb1509dae5b1d6832 Mon Sep 17 00:00:00 2001 From: Mateusz Titz Date: Mon, 19 Aug 2024 11:14:48 +0200 Subject: [PATCH] Fix displaying duplicated own user option in search filters --- src/components/Search/SearchFiltersParticipantsSelector.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Search/SearchFiltersParticipantsSelector.tsx b/src/components/Search/SearchFiltersParticipantsSelector.tsx index b62190267f37..436cdba91af2 100644 --- a/src/components/Search/SearchFiltersParticipantsSelector.tsx +++ b/src/components/Search/SearchFiltersParticipantsSelector.tsx @@ -12,6 +12,7 @@ import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import type {Option} from '@libs/OptionsListUtils'; import type {OptionData} from '@libs/ReportUtils'; +import * as ReportUtils from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; import * as Report from '@userActions/Report'; import CONST from '@src/CONST'; @@ -76,7 +77,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: false, 0, undefined, - true, + false, ); }, [areOptionsInitialized, options.personalDetails, options.reports, selectedOptions]); @@ -108,9 +109,10 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: newSections.push(formattedResults.section); if (chatOptions.currentUserOption && !isCurrentUserSelected) { + const formattedName = ReportUtils.getDisplayNameForParticipant(chatOptions.currentUserOption.accountID, false, true, true, personalDetails); newSections.push({ title: '', - data: [chatOptions.currentUserOption], + data: [{...chatOptions.currentUserOption, text: formattedName}], shouldShow: true, }); }