Skip to content

Commit

Permalink
Sync query and filter when refreshing discover page (#8179)
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 authored Sep 13, 2024
1 parent 9d7c250 commit 41f00e7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ export const useSearch = (services: DiscoverViewServices) => {
const savedSearchInstance = await getSavedSearchById(savedSearchId);
setSavedSearch(savedSearchInstance);

// if saved search does not exist, do not atempt to sync filters and query from savedObject
if (!savedSearch) {
return;
}

// sync initial app filters from savedObject to filterManager
const filters = cloneDeep(savedSearchInstance.searchSource.getOwnField('filter'));
const query =
Expand Down

0 comments on commit 41f00e7

Please sign in to comment.