Skip to content

Commit

Permalink
Merge pull request #2039 from laws-africa/toc-items
Browse files Browse the repository at this point in the history
tolerate TOC tree with no items
  • Loading branch information
longhotsummer authored Sep 17, 2024
2 parents a1807c3 + 1b37a5b commit 3feadb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion peachjam/js/components/taxonomy-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TaxonomyTree {
}

tocController.expanded = expanded;
tocController.items = data[0].children.map((item: TOCItemType) => formatItem(item));
tocController.items = data.length ? data[0].children.map((item: TOCItemType) => formatItem(item)) : [];
tocController.expandAllBtnText = i18next.t('Expand all');
tocController.collapseAllBtnText = i18next.t('Collapse all');
tocController.titleFilterPlaceholder = i18next.t('Search');
Expand Down

0 comments on commit 3feadb7

Please sign in to comment.