Skip to content

Commit

Permalink
fix: SummaryList bug (#2455)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Nov 20, 2023
1 parent a706501 commit 33742d2
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,17 @@ function SummaryListsBySections(props: SummaryListsBySectionsProps) {

const isValidComponent = ([nodeId, userData]: BreadcrumbEntry) => {
const node = props.flow[nodeId];
const Component = node.type && presentationalComponents[node.type];
const doesNodeExist = Boolean(props.flow[nodeId]);
if (!doesNodeExist) return false;

const Component = node.type && presentationalComponents[node.type];
const isPresentationalComponent = Boolean(Component);
const doesNodeExist = Boolean(props.flow[nodeId]);
const isAutoAnswered = userData.auto;
const isInfoOnlyMode =
node.type === TYPES.FileUploadAndLabel &&
props.flow[nodeId].data?.hideDropZone;

return (
doesNodeExist &&
!isAutoAnswered &&
isPresentationalComponent &&
!isInfoOnlyMode
);
return !isAutoAnswered && isPresentationalComponent && !isInfoOnlyMode;
};

const removeNonPresentationalNodes = (
Expand Down

0 comments on commit 33742d2

Please sign in to comment.