Skip to content

Commit

Permalink
remove autosave trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Sep 26, 2023
1 parent c439875 commit 3fe85bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ import { timelineSelectors } from '../../../store/timeline';
import { useShallowEqualSelector } from '../../../../common/hooks/use_selector';
import { timelineDefaults } from '../../../store/timeline/defaults';
import { savedSearchComparator } from './utils';
import {
triggerTimelineDiscoverAutoSave,
setIsDiscoverSavedSearchLoaded,
} from '../../../store/timeline/actions';
import { setIsDiscoverSavedSearchLoaded } from '../../../store/timeline/actions';
import { GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE } from './translations';

const HideSearchSessionIndicatorBreadcrumbIcon = createGlobalStyle`
Expand Down Expand Up @@ -239,7 +236,6 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
const unsubscribeState = stateContainer.appState.state$.subscribe({
next: (state) => {
setDiscoverAppState(state);
dispatch(triggerTimelineDiscoverAutoSave({ id: timelineId }));
},
});

Expand All @@ -261,7 +257,6 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
.subscribe({
next: () => {
setDiscoverTimerange(discoverDataService.query.timefilter.timefilter.getTime());
dispatch(triggerTimelineDiscoverAutoSave({ id: timelineId }));
},
});

Expand All @@ -279,8 +274,6 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
getAppStateFromSavedSearch,
dataView,
setDiscoverAppState,
dispatch,
timelineId,
setDiscoverSavedSearchState,
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,4 @@ export const updateSavedSearchId = actionCreator<{
export const setIsDiscoverSavedSearchLoaded = actionCreator<{
id: string;
isDiscoverSavedSearchLoaded: boolean;
}>('SET_IS_DISCOVER_SAVED_SEARCH_LOADED');

/** To tie the discover state changes to timeline auto save, we use this action
* to trigger the autosave logic managed here: x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts
*/
export const triggerTimelineDiscoverAutoSave = actionCreator<{ id: string }>(
'TRIGGER_TIMELINE_DISCOVER_AUTO_SAVE'
);
}>('SET_IS_DISCOVER_SAVED_SEARCH_LOADED');

0 comments on commit 3fe85bf

Please sign in to comment.