Skip to content

Commit

Permalink
fix: SummaryList bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Nov 19, 2023
1 parent a706501 commit c1ae355
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 c1ae355

Please sign in to comment.