diff --git a/src/pages/ChatFinderPage/index.tsx b/src/pages/ChatFinderPage/index.tsx index f992fa37d8c5..8b968f556b7f 100644 --- a/src/pages/ChatFinderPage/index.tsx +++ b/src/pages/ChatFinderPage/index.tsx @@ -185,7 +185,7 @@ function ChatFinderPage({betas, isSearchingForReports, navigation}: ChatFinderPa onSelectRow={selectReport} showLoadingPlaceholder={!areOptionsInitialized || !isScreenTransitionEnd} footerContent={!isDismissed && ChatFinderPageFooterInstance} - isLoadingNewOptions={isSearchingForReports ?? undefined} + isLoadingNewOptions={!!isSearchingForReports} /> ); diff --git a/src/pages/RoomInvitePage.tsx b/src/pages/RoomInvitePage.tsx index 72000f5eb96d..3d3207cdfe89 100644 --- a/src/pages/RoomInvitePage.tsx +++ b/src/pages/RoomInvitePage.tsx @@ -69,7 +69,8 @@ function RoomInvitePage({ useEffect(() => { setSearchTerm(SearchInputManager.searchInput); - }, [setSearchTerm]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); // Any existing participants and Expensify emails should not be eligible for invitation const excludedUsers = useMemo( diff --git a/src/pages/tasks/TaskShareDestinationSelectorModal.tsx b/src/pages/tasks/TaskShareDestinationSelectorModal.tsx index b4b8f9084a57..5b63b0b090a3 100644 --- a/src/pages/tasks/TaskShareDestinationSelectorModal.tsx +++ b/src/pages/tasks/TaskShareDestinationSelectorModal.tsx @@ -116,7 +116,7 @@ function TaskShareDestinationSelectorModal({isSearchingForReports}: TaskShareDes headerMessage={options.headerMessage} textInputLabel={translate('optionsSelector.nameEmailOrPhoneNumber')} showLoadingPlaceholder={areOptionsInitialized && debouncedSearchValue.trim() === '' ? options.sections.length === 0 : !didScreenTransitionEnd} - isLoadingNewOptions={isSearchingForReports ?? undefined} + isLoadingNewOptions={!!isSearchingForReports} textInputHint={textInputHint} /> diff --git a/src/pages/workspace/WorkspaceInvitePage.tsx b/src/pages/workspace/WorkspaceInvitePage.tsx index cf3cbb133d91..72bdcdb9ecdb 100644 --- a/src/pages/workspace/WorkspaceInvitePage.tsx +++ b/src/pages/workspace/WorkspaceInvitePage.tsx @@ -78,7 +78,8 @@ function WorkspaceInvitePage({route, betas, invitedEmailsToAccountIDsDraft, poli return () => { Policy.setWorkspaceInviteMembersDraft(route.params.policyID, {}); }; - }, [setSearchTerm, route.params.policyID]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [route.params.policyID]); useEffect(() => { Policy.clearErrors(route.params.policyID); @@ -96,7 +97,7 @@ function WorkspaceInvitePage({route, betas, invitedEmailsToAccountIDsDraft, poli const newSelectedOptionsDict: Record = {}; const inviteOptions = OptionsListUtils.getMemberInviteOptions(options.personalDetails, betas ?? [], debouncedSearchTerm, excludedUsers, true); - // Update selectedOptions with the latest personalDetails and policyMembers information + // Update selectedOptions with the latest personalDetails and policyEmployeeList information const detailsMap: Record = {}; inviteOptions.personalDetails.forEach((detail) => { if (!detail.login) { @@ -146,7 +147,7 @@ function WorkspaceInvitePage({route, betas, invitedEmailsToAccountIDsDraft, poli setSelectedOptions(Object.values(newSelectedOptionsDict)); // eslint-disable-next-line react-hooks/exhaustive-deps -- we don't want to recalculate when selectedOptions change - }, [options.personalDetails, policy?.employeeList, betas, searchTerm, excludedUsers]); + }, [options.personalDetails, policy?.employeeList, betas, debouncedSearchTerm, excludedUsers]); const sections: MembersSection[] = useMemo(() => { const sectionsArr: MembersSection[] = [];