@@ -33,7 +33,7 @@ function AddDelegatePage() {
3333 { } as Record < string , boolean > ,
3434 ) ?? { } ;
3535
36- const { searchTerm, debouncedSearchTerm, setSearchTerm, searchOptions , areOptionsInitialized, setSelectedOptions, onListEndReached} = useSearchSelector ( {
36+ const { searchTerm, debouncedSearchTerm, setSearchTerm, availableOptions , areOptionsInitialized, setSelectedOptions, onListEndReached} = useSearchSelector ( {
3737 selectionMode : CONST . SEARCH_SELECTOR . SELECTION_MODE_SINGLE ,
3838 searchContext : CONST . SEARCH_SELECTOR . SEARCH_CONTEXT_GENERAL ,
3939 includeUserToInvite : true ,
@@ -47,33 +47,30 @@ function AddDelegatePage() {
4747 Navigation . navigate ( ROUTES . SETTINGS_DELEGATE_ROLE . getRoute ( option . login ?? '' ) ) ;
4848 } ;
4949
50- const recentReportLogins = new Set ( searchOptions . recentReports . map ( ( option ) => option . login ) . filter ( Boolean ) ) ;
51- const dedupedPersonalDetails = searchOptions . personalDetails . filter ( ( option ) => ! recentReportLogins . has ( option . login ) ) ;
52-
5350 const headerMessage = getHeaderMessage (
54- ( searchOptions . recentReports ?. length || 0 ) + ( dedupedPersonalDetails ?. length || 0 ) !== 0 ,
55- ! ! searchOptions . userToInvite ,
51+ ( availableOptions . recentReports ?. length || 0 ) + ( availableOptions . personalDetails ?. length || 0 ) !== 0 ,
52+ ! ! availableOptions . userToInvite ,
5653 debouncedSearchTerm ,
5754 countryCode ,
5855 ) ;
5956 const sectionsList = [
6057 {
6158 title : translate ( 'common.recents' ) ,
6259 sectionIndex : 0 ,
63- data : searchOptions . recentReports ,
60+ data : availableOptions . recentReports ,
6461 } ,
6562 {
6663 title : translate ( 'common.contacts' ) ,
6764 sectionIndex : 1 ,
68- data : dedupedPersonalDetails ,
65+ data : availableOptions . personalDetails ,
6966 } ,
7067 ] ;
7168
72- if ( searchOptions . userToInvite ) {
69+ if ( availableOptions . userToInvite ) {
7370 sectionsList . push ( {
7471 sectionIndex : 2 ,
7572 title : '' ,
76- data : [ searchOptions . userToInvite ] ,
73+ data : [ availableOptions . userToInvite ] ,
7774 } ) ;
7875 }
7976
0 commit comments