Skip to content

Commit

Permalink
Fix overview page crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
machadoum committed Oct 6, 2021
1 parent 156b40c commit 7e27b6f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React from 'react';
import React, { useMemo } from 'react';
import { RiskyHostsPanelView } from './risky_hosts_panel_view';
import { LinkPanelListItem } from '../link_panel';
import { useRiskyHostsDashboardButtonHref } from '../../containers/overview_risky_host_links/use_risky_hosts_dashboard_button_href';
Expand All @@ -27,7 +27,10 @@ const RiskyHostsEnabledModuleComponent: React.FC<{
hostRiskScore: HostRisk;
to: string;
}> = ({ hostRiskScore, to, from }) => {
const listItems = getListItemsFromHits(hostRiskScore?.result || []);
const listItems = useMemo(
() => getListItemsFromHits(hostRiskScore?.result || []),
[hostRiskScore]
);
const { buttonHref } = useRiskyHostsDashboardButtonHref(to, from);
const { listItemsWithLinks } = useRiskyHostsDashboardLinks(to, from, listItems);

Expand Down

0 comments on commit 7e27b6f

Please sign in to comment.