11import isEmpty from 'lodash/isEmpty' ;
2- import React , { memo , useCallback , useEffect , useMemo , useState } from 'react' ;
2+ import React , { memo , useCallback , useMemo , useState } from 'react' ;
33import { View } from 'react-native' ;
44import Button from '@components/Button' ;
55import { usePersonalDetails } from '@components/OnyxProvider' ;
66import { useOptionsList } from '@components/OptionListContextProvider' ;
77import SelectionList from '@components/SelectionList' ;
88import UserSelectionListItem from '@components/SelectionList/Search/UserSelectionListItem' ;
9- import useDebouncedState from '@hooks/useDebouncedState' ;
109import useLocalize from '@hooks/useLocalize' ;
1110import useOnyx from '@hooks/useOnyx' ;
1211import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
@@ -16,7 +15,6 @@ import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus';
1615import type { Option , Section } from '@libs/OptionsListUtils' ;
1716import { filterAndOrderOptions , getValidOptions } from '@libs/OptionsListUtils' ;
1817import type { OptionData } from '@libs/ReportUtils' ;
19- import { searchInServer } from '@userActions/Report' ;
2018import CONST from '@src/CONST' ;
2119import ONYXKEYS from '@src/ONYXKEYS' ;
2220
@@ -45,7 +43,7 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps)
4543 const [ accountID ] = useOnyx ( ONYXKEYS . SESSION , { canBeMissing : true , selector : ( onyxSession ) => onyxSession ?. accountID } ) ;
4644 const shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus ( ) ;
4745
48- const [ searchTerm , debouncedSearchTerm , setSearchTerm ] = useDebouncedState ( '' ) ;
46+ const [ searchTerm , setSearchTerm ] = useState ( '' ) ;
4947 const [ isSearchingForReports ] = useOnyx ( ONYXKEYS . IS_SEARCHING_FOR_REPORTS , { initWithStoredValues : false , canBeMissing : true } ) ;
5048 const [ selectedOptions , setSelectedOptions ] = useState < Option [ ] > ( ( ) => {
5149 return value . reduce < OptionData [ ] > ( ( acc , id ) => {
@@ -83,6 +81,7 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps)
8381 const { personalDetails : filteredOptionsList , recentReports} = filterAndOrderOptions ( optionsList , cleanSearchTerm , {
8482 excludeLogins : CONST . EXPENSIFY_EMAILS_OBJECT ,
8583 maxRecentReportsToShow : CONST . IOU . MAX_RECENT_REPORTS_TO_SHOW ,
84+ canInviteUser : false ,
8685 } ) ;
8786
8887 const personalDetailList = filteredOptionsList
@@ -154,10 +153,6 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps)
154153 closeOverlay ( ) ;
155154 } , [ closeOverlay , onChange ] ) ;
156155
157- useEffect ( ( ) => {
158- searchInServer ( debouncedSearchTerm . trim ( ) ) ;
159- } , [ debouncedSearchTerm ] ) ;
160-
161156 const isLoadingNewOptions = ! ! isSearchingForReports ;
162157 const dataLength = sections . flatMap ( ( section ) => section . data ) . length ;
163158
0 commit comments