Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/pages/Search/SearchMoneyRequestReportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SearchFullscreenNavigatorParamList} from '@libs/Navigation/types';
import {isValidReportIDFromPath} from '@libs/ReportUtils';
import {buildSearchQueryJSON} from '@libs/SearchQueryUtils';
import Navigation from '@navigation/Navigation';
import ReactionListWrapper from '@pages/home/ReactionListWrapper';
import variables from '@styles/variables';
Expand Down Expand Up @@ -65,6 +66,13 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
openReport(reportIDFromRoute, '', [], undefined, undefined, false, [], undefined, true);
}, [reportIDFromRoute]);

const queryJSON = useMemo(() => {
const backTo = route.params.backTo ?? '';
const queryString = backTo.split('?').at(1) ?? '';
const q = new URLSearchParams(queryString).get('q') ?? '';
return buildSearchQueryJSON(q);
}, [route.params.backTo]);

// eslint-disable-next-line rulesdir/no-negated-variables
const shouldShowNotFoundPage = useMemo(
(): boolean => {
Expand Down Expand Up @@ -134,7 +142,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
shouldDisplaySearch={false}
shouldShowLoadingBar={false}
/>
<SearchTypeMenu queryJSON={undefined} />
<SearchTypeMenu queryJSON={queryJSON} />
</View>
<NavigationTabBar selectedTab={NAVIGATION_TABS.SEARCH} />
</View>
Expand Down