diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index f336740a8558..d645be6b17be 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -18,7 +18,6 @@ import useNetwork from '@hooks/useNetwork'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import {turnOffMobileSelectionMode} from '@libs/actions/MobileSelectionMode'; import * as SearchActions from '@libs/actions/Search'; import Navigation from '@libs/Navigation/Navigation'; import * as SearchUtils from '@libs/SearchUtils'; @@ -126,7 +125,7 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa const {isOffline} = useNetwork(); const {activeWorkspaceID} = useActiveWorkspace(); const {shouldUseNarrowLayout} = useResponsiveLayout(); - const {selectedTransactions, clearSelectedTransactions} = useSearchContext(); + const {selectedTransactions} = useSearchContext(); const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); const selectedTransactionsKeys = Object.keys(selectedTransactions ?? {}); @@ -196,9 +195,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa return; } - if (selectionMode?.isEnabled) { - turnOffMobileSelectionMode(); - } Navigation.navigate(ROUTES.TRANSACTION_HOLD_REASON_RHP); }, }); @@ -218,10 +214,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa return; } - clearSelectedTransactions(); - if (selectionMode?.isEnabled) { - turnOffMobileSelectionMode(); - } SearchActions.unholdMoneyRequestOnSearch(hash, selectedTransactionsKeys); }, }); @@ -272,7 +264,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa selectedTransactions, translate, onSelectDeleteOption, - clearSelectedTransactions, hash, theme.icon, styles.colorMuted, @@ -283,7 +274,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa activeWorkspaceID, selectedReports, styles.textWrap, - selectionMode?.isEnabled, ]); if (shouldUseNarrowLayout) { diff --git a/src/pages/Search/SearchHoldReasonPage.tsx b/src/pages/Search/SearchHoldReasonPage.tsx index 7ea22421737d..edd85e78cec2 100644 --- a/src/pages/Search/SearchHoldReasonPage.tsx +++ b/src/pages/Search/SearchHoldReasonPage.tsx @@ -25,13 +25,12 @@ type SearchHoldReasonPageProps = { function SearchHoldReasonPage({route}: SearchHoldReasonPageProps) { const {translate} = useLocalize(); - const {currentSearchHash, selectedTransactions, clearSelectedTransactions} = useSearchContext(); + const {currentSearchHash, selectedTransactions} = useSearchContext(); const {backTo = ''} = route.params ?? {}; const selectedTransactionIDs = Object.keys(selectedTransactions); const onSubmit = (values: FormOnyxValues) => { SearchActions.holdMoneyRequestOnSearch(currentSearchHash, selectedTransactionIDs, values.comment); - clearSelectedTransactions(); Navigation.goBack(); };