@@ -50,14 +50,14 @@ type Sections = Array<SectionListData<MemberForList, Section<MemberForList>>>;
5050
5151function InviteReportParticipantsPage ( { betas, report, didScreenTransitionEnd} : InviteReportParticipantsPageProps ) {
5252 const route = useRoute < PlatformStackRouteProp < ParticipantsNavigatorParamList , typeof SCREENS . REPORT_PARTICIPANTS . INVITE > > ( ) ;
53- const [ countryCode ] = useOnyx ( ONYXKEYS . COUNTRY_CODE , { canBeMissing : false } ) ;
5453 const { options, areOptionsInitialized} = useOptionsList ( {
5554 shouldInitialize : didScreenTransitionEnd ,
5655 } ) ;
5756
5857 const styles = useThemeStyles ( ) ;
5958 const { translate, formatPhoneNumber} = useLocalize ( ) ;
6059 const [ personalDetails ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST , { canBeMissing : false } ) ;
60+ const [ countryCode ] = useOnyx ( ONYXKEYS . COUNTRY_CODE , { canBeMissing : false } ) ;
6161 const [ userSearchPhrase ] = useOnyx ( ONYXKEYS . ROOM_MEMBERS_USER_SEARCH_PHRASE , { canBeMissing : true } ) ;
6262 const [ searchValue , debouncedSearchTerm , setSearchValue ] = useDebouncedState ( userSearchPhrase ?? '' ) ;
6363 const [ selectedOptions , setSelectedOptions ] = useState < OptionData [ ] > ( [ ] ) ;
@@ -88,7 +88,10 @@ function InviteReportParticipantsPage({betas, report, didScreenTransitionEnd}: I
8888 return getMemberInviteOptions ( options . personalDetails , betas ?? [ ] , excludedUsers , false , options . reports , true ) ;
8989 } , [ areOptionsInitialized , betas , excludedUsers , options . personalDetails , options . reports ] ) ;
9090
91- const inviteOptions = useMemo ( ( ) => filterAndOrderOptions ( defaultOptions , debouncedSearchTerm , { excludeLogins : excludedUsers } ) , [ debouncedSearchTerm , defaultOptions , excludedUsers ] ) ;
91+ const inviteOptions = useMemo (
92+ ( ) => filterAndOrderOptions ( defaultOptions , debouncedSearchTerm , countryCode , { excludeLogins : excludedUsers } ) ,
93+ [ debouncedSearchTerm , defaultOptions , excludedUsers , countryCode ] ,
94+ ) ;
9295
9396 useEffect ( ( ) => {
9497 // Update selectedOptions with the latest personalDetails information
0 commit comments