Skip to content

Commit

Permalink
remove break in find deep fragments function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sartxi committed Jul 23, 2024
1 parent 5a4444e commit 0fbbee6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libs/blocks/locui/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ async function findDeepFragments(path) {
const nestedFragments = await findPageFragments(search.pathname);
if (nestedFragments === undefined) {
search.valid = 'not found';
searched.push(search.pathname);
break;
} else {
const newFragments = nestedFragments.filter((nested) => !searched.includes(nested.pathname)
&& !fragments.find((fragment) => fragment.pathname === nested.pathname));
if (newFragments?.length) fragments.push(...newFragments);
}
const newFragments = nestedFragments.filter((nested) => !searched.includes(nested.pathname)
&& !fragments.find((fragment) => fragment.pathname === nested.pathname));
if (newFragments?.length) fragments.push(...newFragments);
searched.push(search.pathname);
}
}
Expand Down

0 comments on commit 0fbbee6

Please sign in to comment.