Skip to content

Commit

Permalink
work with valid objects that weren't filtered out
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Aug 16, 2024
1 parent 7db7d19 commit cf47086
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/filters/reconnect/mcparticletree.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const findParticles = (otherObject, relationName, ids) => {

if (relationObjects.length === 0) return [];

relationObjects.filter((object) =>
const validObjects = relationObjects.filter((object) =>
ids.has(`${object.index}-${object.collectionId}`)
);

return relationObjects.length > 0
? relationObjects
return validObjects.length > 0
? validObjects
: relationObjects
.map((object) => findParticles(object, relationName, ids))
.flat();
Expand Down

0 comments on commit cf47086

Please sign in to comment.