@@ -19,6 +19,7 @@ import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
1919import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
2020import type { SearchFullscreenNavigatorParamList } from '@libs/Navigation/types' ;
2121import { isValidReportIDFromPath } from '@libs/ReportUtils' ;
22+ import { buildSearchQueryJSON } from '@libs/SearchQueryUtils' ;
2223import Navigation from '@navigation/Navigation' ;
2324import ReactionListWrapper from '@pages/home/ReactionListWrapper' ;
2425import variables from '@styles/variables' ;
@@ -65,6 +66,13 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
6566 openReport ( reportIDFromRoute , '' , [ ] , undefined , undefined , false , [ ] , undefined , true ) ;
6667 } , [ reportIDFromRoute ] ) ;
6768
69+ const queryJSON = useMemo ( ( ) => {
70+ const backTo = route . params . backTo ?? '' ;
71+ const queryString = backTo . split ( '?' ) . at ( 1 ) ?? '' ;
72+ const q = new URLSearchParams ( queryString ) . get ( 'q' ) ?? '' ;
73+ return buildSearchQueryJSON ( q ) ;
74+ } , [ route . params . backTo ] ) ;
75+
6876 // eslint-disable-next-line rulesdir/no-negated-variables
6977 const shouldShowNotFoundPage = useMemo (
7078 ( ) : boolean => {
@@ -134,7 +142,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
134142 shouldDisplaySearch = { false }
135143 shouldShowLoadingBar = { false }
136144 />
137- < SearchTypeMenu queryJSON = { undefined } />
145+ < SearchTypeMenu queryJSON = { queryJSON } />
138146 </ View >
139147 < NavigationTabBar selectedTab = { NAVIGATION_TABS . SEARCH } />
140148 </ View >
0 commit comments