Skip to content

Commit

Permalink
[Resolver] Only render resolver once we have a signals index
Browse files Browse the repository at this point in the history
  • Loading branch information
oatkiller authored and jonathan-buttner committed Sep 3, 2020
1 parent 97e14dd commit e529bee
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,12 @@ const GraphOverlayComponent = ({

const { signalIndexName } = useSignalIndex();
const [siemDefaultIndices] = useUiSetting$<string[]>(DEFAULT_INDEX_KEY);
const indices: string[] = useMemo(() => {
const allIndices = [...siemDefaultIndices];

if (signalIndexName !== null) {
allIndices.push(signalIndexName);
const indices: string[] | null = useMemo(() => {
if (signalIndexName === null) {
return null;
} else {
return [...siemDefaultIndices, signalIndexName];
}
return allIndices;
}, [signalIndexName, siemDefaultIndices]);

return (
Expand Down Expand Up @@ -191,7 +190,7 @@ const GraphOverlayComponent = ({
</EuiFlexGroup>

<EuiHorizontalRule margin="none" />
{graphEventId !== undefined && (
{graphEventId !== undefined && indices !== null && (
<StyledResolver
databaseDocumentID={graphEventId}
resolverComponentInstanceID={currentTimeline.id}
Expand Down

0 comments on commit e529bee

Please sign in to comment.