Skip to content

Commit

Permalink
Merge pull request #51702 from Expensify/bondy-remove-debounce
Browse files Browse the repository at this point in the history
[CP stg] Report Participant Page - remove debounce to allow member search

(cherry picked from commit a739661)

(CP triggered by grgia)
  • Loading branch information
Beamanator authored and OSBotify committed Oct 30, 2024
1 parent 9772272 commit ede08c8
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import TableListItem from '@components/SelectionList/TableListItem';
import type {ListItem, SelectionListHandle} from '@components/SelectionList/types';
import SelectionListWithModal from '@components/SelectionListWithModal';
import Text from '@components/Text';
import useDebouncedState from '@hooks/useDebouncedState';
import useLocalize from '@hooks/useLocalize';
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
import useNetwork from '@hooks/useNetwork';
Expand Down Expand Up @@ -67,18 +66,7 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
const isFocused = useIsFocused();
const {isOffline} = useNetwork();
const canSelectMultiple = isGroupChat && isCurrentUserAdmin && (isSmallScreenWidth ? selectionMode?.isEnabled : true);
const [searchValue, debouncedSearchValue, setSearchValue] = useDebouncedState('');

useEffect(
() => () => {
UserSearchPhraseActions.clearUserSearchPhrase();
},
[],
);

useEffect(() => {
UserSearchPhraseActions.updateUserSearchPhrase(debouncedSearchValue);
}, [debouncedSearchValue]);
const [searchValue, setSearchValue] = useState('');

useEffect(() => {
if (isFocused) {
Expand Down Expand Up @@ -424,9 +412,7 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) {
shouldShowTextInput={shouldShowTextInput}
textInputLabel={translate('selectionList.findMember')}
textInputValue={searchValue}
onChangeText={(value) => {
setSearchValue(value);
}}
onChangeText={setSearchValue}
headerMessage={headerMessage}
ListItem={TableListItem}
onSelectRow={openMemberDetails}
Expand Down

0 comments on commit ede08c8

Please sign in to comment.