Skip to content

Commit

Permalink
Merge pull request #14502 from storybookjs/13687-nonexistent-ids
Browse files Browse the repository at this point in the history
UI: Skip duplicate storyId breaking sidebar
  • Loading branch information
shilman committed Apr 7, 2021
2 parents 01d3f8f + 7e0385c commit 8a40dbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ui/src/components/sidebar/utils.ts
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 8a40dbd

Please sign in to comment.