From cf47086adbcf7680bffd269bc858b7fc39bf82f1 Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Fri, 16 Aug 2024 10:19:42 -0500 Subject: [PATCH] work with valid objects that weren't filtered out --- js/filters/reconnect/mcparticletree.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/filters/reconnect/mcparticletree.js b/js/filters/reconnect/mcparticletree.js index 9561254..639ddb0 100644 --- a/js/filters/reconnect/mcparticletree.js +++ b/js/filters/reconnect/mcparticletree.js @@ -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();