Skip to content

Commit

Permalink
Merge pull request #47625 from software-mansion-labs/kicu/47537-fix-s…
Browse files Browse the repository at this point in the history
…elf-filter

Fix displaying duplicated own user option in search filters
  • Loading branch information
luacmartins authored Aug 19, 2024
2 parents 81998f6 + b28271f commit 74f095d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Search/SearchFiltersParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -76,7 +77,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
false,
0,
undefined,
true,
false,
);
}, [areOptionsInitialized, options.personalDetails, options.reports, selectedOptions]);

Expand Down Expand Up @@ -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,
});
}
Expand Down

0 comments on commit 74f095d

Please sign in to comment.