Skip to content

Commit c5121b3

Browse files
authored
Merge pull request #90107 from Expensify/revert-88118-fix/search-params-overwrite
[CP Staging] Revert "Fix navigation arrows disappearing during report browsing"
2 parents 9365dd7 + f5906fb commit c5121b3

4 files changed

Lines changed: 1 addition & 22 deletions

File tree

src/components/MoneyRequestReportView/MoneyRequestReportNavigation.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ function MoneyRequestReportNavigationInner({reportID, shouldDisplayNarrowVersion
158158
shouldCalculateTotals: false,
159159
searchKey: lastSearchQuery.searchKey,
160160
isLoading: isSearchLoading,
161-
shouldUpdateLastSearchParams: true,
162161
});
163162
}
164163

src/components/Search/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import useSearchHighlightAndScroll from '@hooks/useSearchHighlightAndScroll';
2727
import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals';
2828
import useThemeStyles from '@hooks/useThemeStyles';
2929
import {turnOffMobileSelectionMode, turnOnMobileSelectionMode} from '@libs/actions/MobileSelectionMode';
30-
import {saveLastSearchParams} from '@libs/actions/ReportNavigation';
3130
import type {TransactionPreviewData} from '@libs/actions/Search';
3231
import {setOptimisticDataForTransactionThreadPreview} from '@libs/actions/Search';
3332
import {flushDeferredWrite, getOptimisticWatchKey, hasDeferredWrite} from '@libs/deferredLayoutWrite';
@@ -1208,16 +1207,6 @@ function Search({
12081207
unmarkReportIDAsMultiTransactionExpense(reportID);
12091208
}
12101209

1211-
// Persist the current search context so prev/next navigation arrows
1212-
// in the report RHP can reference the correct result set.
1213-
saveLastSearchParams({
1214-
queryJSON,
1215-
offset,
1216-
searchKey: currentSearchKey,
1217-
hasMoreResults: !!searchResults?.search?.hasMoreResults,
1218-
allowPostSearchRecount: true,
1219-
});
1220-
12211210
requestAnimationFrame(() => Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID, backTo})));
12221211
return;
12231212
}
@@ -1258,9 +1247,6 @@ function Search({
12581247
betas,
12591248
email,
12601249
accountID,
1261-
queryJSON,
1262-
offset,
1263-
searchResults?.search?.hasMoreResults,
12641250
],
12651251
);
12661252

src/hooks/useSearchPageSetup.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {useFocusEffect} from '@react-navigation/native';
22
import {useEffect} from 'react';
33
import {useSearchActionsContext, useSearchStateContext} from '@components/Search/SearchContext';
44
import type {SearchQueryJSON} from '@components/Search/types';
5-
import {saveLastSearchParams} from '@libs/actions/ReportNavigation';
65
import {openSearch, search} from '@libs/actions/Search';
76
import {hasDeferredWrite} from '@libs/deferredLayoutWrite';
87
import {isSearchDataLoaded} from '@libs/SearchUIUtils';
@@ -57,11 +56,6 @@ function useSearchPageSetup(queryJSON: Readonly<SearchQueryJSON> | undefined) {
5756
}
5857
const shouldSkipWaitForWrites = hasDeferredWrite(CONST.DEFERRED_LAYOUT_WRITE_KEYS.SEARCH);
5958
search({queryJSON, searchKey: currentSearchKey, offset: 0, shouldCalculateTotals, isLoading: false, skipWaitForWrites: shouldSkipWaitForWrites});
60-
61-
// Save query context so SearchTabButton can restore the last search when
62-
// the user returns to the Search tab. This is the explicit replacement for
63-
// the old implicit save-on-every-search() default.
64-
saveLastSearchParams({queryJSON, offset: 0, searchKey: currentSearchKey, hasMoreResults: false, allowPostSearchRecount: false});
6559
}, [hash, isOffline, shouldUseLiveData, queryJSON, isSnapshotDataLoaded, isSnapshotSearchLoading, currentSearchKey, shouldCalculateTotals]);
6660

6761
useFocusEffect(() => {

src/libs/actions/Search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ function search({
531531
prevReportsLength,
532532
isOffline = false,
533533
isLoading,
534-
shouldUpdateLastSearchParams = false,
534+
shouldUpdateLastSearchParams = true,
535535
skipWaitForWrites = false,
536536
}: {
537537
queryJSON: Readonly<SearchQueryJSON>;

0 commit comments

Comments
 (0)