Skip to content

Commit

Permalink
fix: esql tab reverts to kql
Browse files Browse the repository at this point in the history
  • Loading branch information
logeekal committed Oct 12, 2023
1 parent dfd35c6 commit 0b5dfdc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
if (!savedObjectId) return;
if (!status || status === 'draft') return;
const latestState = getCombinedDiscoverSavedSearchState();
const index = latestState?.searchSource.getField('index');
/* when a new timeline is loaded, a new discover instance is loaded which first emits
* discover's initial state which is then updated in the saved search. We want to avoid that.*/
if (!index) return;
if (!latestState || combinedDiscoverSavedSearchStateRef.current === latestState) return;
if (isEqualWith(latestState, savedSearchById, savedSearchComparator)) return;
debouncedUpdateSavedSearch(latestState, timelineId);
Expand Down

0 comments on commit 0b5dfdc

Please sign in to comment.