Skip to content

Commit

Permalink
replace default query with current query
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <[email protected]>
  • Loading branch information
sejli committed Nov 26, 2024
1 parent 073a9ff commit 6a30fbe
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ export const useSearch = (services: DiscoverViewServices) => {
const savedSearchInstance = await getSavedSearchById(savedSearchId);

const query =
savedSearchInstance.searchSource.getField('query') ||
data.query.queryString.getDefaultQuery();
savedSearchInstance.searchSource.getField('query') || data.query.queryString.getQuery();

const isEnhancementsEnabled = await uiSettings.get('query:enhancements:enabled');
if (isEnhancementsEnabled && query.dataset) {
Expand Down Expand Up @@ -432,7 +431,7 @@ export const useSearch = (services: DiscoverViewServices) => {
}

filterManager.setAppFilters(actualFilters);
data.query.queryString.setQuery(savedQuery ? data.query.queryString.getQuery() : query);
data.query.queryString.setQuery(query);
setSavedSearch(savedSearchInstance);

if (savedSearchInstance?.id) {
Expand Down

0 comments on commit 6a30fbe

Please sign in to comment.