Skip to content

Commit

Permalink
no need to fake index just return null
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Jul 9, 2020
1 parent 1119ff4 commit 72551f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions x-pack/plugins/security_solution/public/app/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { useWithSource } from '../../common/containers/source';
import { useShowTimeline } from '../../common/utils/timeline/use_show_timeline';
import { navTabs } from './home_navigations';
import { useSignalIndex } from '../../alerts/containers/detection_engine/alerts/use_signal_index';
import { NO_ALERT_INDEX } from '../../../common/constants';

const WrappedByAutoSizer = styled.div`
height: 100%;
Expand Down Expand Up @@ -59,11 +58,11 @@ export const HomePage: React.FC<HomePageProps> = ({ children }) => {
);
const { signalIndexExists, signalIndexName } = useSignalIndex();

const indexToAdd = useMemo<string[]>(() => {
const indexToAdd = useMemo<string[] | null>(() => {
if (signalIndexExists && signalIndexName != null) {
return [signalIndexName];
}
return [NO_ALERT_INDEX]; // Following index does not exist so we won't show any events;
return null;
}, [signalIndexExists, signalIndexName]);

const [showTimeline] = useShowTimeline();
Expand Down

0 comments on commit 72551f5

Please sign in to comment.