From 02ba35fc23d4f81f611f77fa8a220f19a8d0c0ad Mon Sep 17 00:00:00 2001 From: David Bondy Date: Tue, 29 Oct 2024 16:03:55 -0600 Subject: [PATCH 1/2] remove debounce and just rely on normal state management --- src/pages/ReportParticipantsPage.tsx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/pages/ReportParticipantsPage.tsx b/src/pages/ReportParticipantsPage.tsx index 8029067f5026..07ae32ad79b5 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -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'; @@ -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) { From e99cd841787c94a9f6879415e5aedb6fe3d9366e Mon Sep 17 00:00:00 2001 From: David Bondy Date: Tue, 29 Oct 2024 16:19:43 -0600 Subject: [PATCH 2/2] simplify updating state --- src/pages/ReportParticipantsPage.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/ReportParticipantsPage.tsx b/src/pages/ReportParticipantsPage.tsx index 07ae32ad79b5..405e1dd688f2 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -412,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}