Skip to content

Commit

Permalink
DOP-3436 front end (#748)
Browse files Browse the repository at this point in the history
check for children existence for toc node
  • Loading branch information
seungpark authored Jan 6, 2023
1 parent cb36360 commit 6516570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Sidenav/TOCNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Wrapper = ({ children, hasVersions }) => {
const TOCNode = ({ activeSection, handleClick, level = BASE_NODE_LEVEL, node }) => {
const { title, slug, url, children, options = {} } = node;
const target = slug || url;
const hasChildren = !!children.length;
const hasChildren = !!children?.length;
const hasVersions = !!(options?.versions?.length > 1); // in the event there is only one version, do we show version selector?
const isActive = isActiveTocNode(activeSection, slug, children);
const isSelected = isSelectedTocNode(activeSection, slug);
Expand Down

0 comments on commit 6516570

Please sign in to comment.