From 368945838f6f46321402537ec63e2d38fb9c7c73 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Mon, 23 Dec 2024 15:15:58 +0300 Subject: [PATCH 1/2] display results if search already exists --- src/pages/Search/AdvancedSearchFilters.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index 02eca4b9fbbc..5e75925003e2 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -434,8 +434,8 @@ function AdvancedSearchFilters() { const onSaveSearch = () => { const savedSearchKeys = Object.keys(savedSearches ?? {}); if (!queryJSON || (savedSearches && savedSearchKeys.includes(String(queryJSON.hash)))) { - // If the search is already saved, return early to prevent unnecessary API calls - Navigation.dismissModal(); + // If the search is already saved, we only display the results as we don't need to save it. + applyFiltersAndNavigate(); return; } From 3ff57e09342ca8a545714e6ee2d18e227b547414 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Thu, 2 Jan 2025 19:00:47 +0300 Subject: [PATCH 2/2] fix lint --- src/pages/Search/AdvancedSearchFilters.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index bcafcbd5acb7..ccb4bbfe5da1 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -372,7 +372,7 @@ function AdvancedSearchFilters() { const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT); const [savedSearches] = useOnyx(ONYXKEYS.SAVED_SEARCHES); const [searchAdvancedFilters = {} as SearchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); - const policyID = searchAdvancedFilters.policyID ?? '-1'; + const policyID = searchAdvancedFilters.policyID; const [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST); const taxRates = getAllTaxRates(); const personalDetails = usePersonalDetails();