Skip to content

Commit

Permalink
Skip invalid ids in dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Apr 7, 2021
1 parent 01d3f8f commit 7e0385c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ui/src/components/sidebar/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const getDescendantIds = memoize(1000)(
(data: StoriesHash, id: string, skipLeafs: boolean): string[] => {
const { children = [] } = data[id] || {};
return children.reduce((acc, childId) => {
if (skipLeafs && data[childId].isLeaf) return acc;
if (!data[childId] || (skipLeafs && data[childId].isLeaf)) return acc;
acc.push(childId, ...getDescendantIds(data, childId, skipLeafs));
return acc;
}, []);
Expand Down

0 comments on commit 7e0385c

Please sign in to comment.