From 55a821f193754e7f73f7a085a38908c2fe665567 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 6 Jun 2023 16:29:09 +0200 Subject: [PATCH] :bug: Fix copy paste can produce nested components in copies --- common/src/app/common/pages/helpers.cljc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/pages/helpers.cljc b/common/src/app/common/pages/helpers.cljc index 67012b8ce..a9b4fb966 100644 --- a/common/src/app/common/pages/helpers.cljc +++ b/common/src/app/common/pages/helpers.cljc @@ -312,14 +312,13 @@ (defn components-nesting-loop? "Check if a nesting loop would be created if the given shape is moved below the given parent" [objects shape-id parent-id] - (let [children (get-children-with-self objects shape-id) - xf-get-component-id (keep :component-id) + (let [xf-get-component-id (keep :component-id) + + children (get-children-with-self objects shape-id) child-components (into #{} xf-get-component-id children) parents (get-parents-with-self objects parent-id) - xf-get-main-id (comp (filter :main-instance?) - xf-get-component-id) - parent-components (into #{} xf-get-main-id parents)] + parent-components (into #{} xf-get-component-id parents)] (seq (set/intersection child-components parent-components)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;