Skip to content

Commit

Permalink
Merge pull request Expensify#54474 from FitseTLT/fix-to-show-results-…
Browse files Browse the repository at this point in the history
…on-saving-already-saved-search

Fix - Filter mismatch on "Save Search" , Filters page shows the currency selected, but the results do not match the filter.
  • Loading branch information
madmax330 authored Jan 9, 2025
2 parents 6cd83a6 + 3ff57e0 commit 6ce82c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/Search/AdvancedSearchFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6ce82c8

Please sign in to comment.