Skip to content

Commit

Permalink
fixes type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed Oct 19, 2022
1 parent 5a4452d commit e6a4c20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ const AlertContextMenuComponent: React.FC<AlertContextMenuProps & PropsFromRedux
} = useExceptionFlyout({
refetch: refetchAll,
onRuleChange,
timelineId,
isActiveTimelines: isActiveTimeline(scopeId ?? ''),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
import { useCallback, useState } from 'react';
import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';

import { TimelineId } from '../../../../../common/types/timeline';
import type { inputsModel } from '../../../../common/store';

interface UseExceptionFlyoutProps {
refetch?: inputsModel.Refetch;
timelineId: string;
onRuleChange?: () => void;
isActiveTimelines: boolean;
}
Expand All @@ -31,7 +29,6 @@ interface UseExceptionFlyout {

export const useExceptionFlyout = ({
refetch,
timelineId,
onRuleChange,
isActiveTimelines,
}: UseExceptionFlyoutProps): UseExceptionFlyout => {
Expand All @@ -52,15 +49,15 @@ export const useExceptionFlyout = ({

const onAddExceptionConfirm = useCallback(
(didRuleChange: boolean, didCloseAlert: boolean, didBulkCloseAlert) => {
if (refetch && (timelineId !== TimelineId.active || didBulkCloseAlert)) {
if (refetch && (isActiveTimelines === false || didBulkCloseAlert)) {
refetch();
}
if (onRuleChange != null && didRuleChange) {
onRuleChange();
}
setOpenAddExceptionFlyout(false);
},
[onRuleChange, refetch, timelineId, isActiveTimelines]
[onRuleChange, refetch, isActiveTimelines]
);

return {
Expand Down

0 comments on commit e6a4c20

Please sign in to comment.