Skip to content

Commit

Permalink
Handle undefined case for displayInsights
Browse files Browse the repository at this point in the history
  • Loading branch information
tituomin committed Sep 26, 2023
1 parent 9a64ddc commit 71122a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/indicators/IndicatorList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const getFirstUsableCategoryType = (categoryTypes, indicators) =>
interface Props {
title: string;
leadContent: IndicatorListPage['leadContent'];
displayInsights: boolean;
displayInsights: IndicatorListPage['displayInsights'];
}

const IndicatorList = ({ title, leadContent, displayInsights }: Props) => {
Expand Down Expand Up @@ -333,7 +333,7 @@ const IndicatorList = ({ title, leadContent, displayInsights }: Props) => {

const indicatorListProps = getIndicatorListProps(data);
const hierarchy = processCommonIndicatorHierarchy(data?.planIndicators);
const showInsights = displayInsights && hasInsights(data);
const showInsights = (displayInsights ?? true) && hasInsights(data);

const categoryType = getFirstUsableCategoryType(
data?.plan?.categoryTypes,
Expand Down

0 comments on commit 71122a2

Please sign in to comment.