Skip to content

Commit 7450238

Browse files
authored
Merge pull request Expensify#78043 from samranahm/77537search-expense-merchant-brief
fix: prevent automatic redirection to actionable search when viewing Expensify purchases
2 parents a1e04dd + 12c7be2 commit 7450238

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/pages/settings/Subscription/CardSection/CardSection.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ function CardSection() {
7979
}, []);
8080

8181
const viewPurchases = useCallback(() => {
82-
const query = buildQueryStringFromFilterFormValues({merchant: CONST.EXPENSIFY_MERCHANT});
83-
Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query}));
82+
const query = buildQueryStringFromFilterFormValues({
83+
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
84+
status: CONST.SEARCH.STATUS.EXPENSE.ALL,
85+
merchant: CONST.EXPENSIFY_MERCHANT,
86+
});
87+
88+
// rawQuery is needed to populate rawFilterList, which prevents useSuggestedSearchDefaultNavigation from auto-redirecting to actionable searches.
89+
Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query, rawQuery: query}));
8490
}, []);
8591

8692
const [billingStatus, setBillingStatus] = useState<BillingStatusResult | undefined>(() =>

0 commit comments

Comments
 (0)