🐛 Fix is-main-of? calculation for v2 components

This commit is contained in:
Alejandro Alonso 2024-03-21 10:48:47 +01:00 committed by Andrés Moya
parent 8f156a7fd0
commit b9743891bb
3 changed files with 24 additions and 20 deletions

View file

@ -138,10 +138,10 @@
(= (:component-file shape) file-id)))
(defn is-main-of?
[shape-main shape-inst]
(and (:shape-ref shape-inst)
(or (= (:shape-ref shape-inst) (:id shape-main))
(= (:shape-ref shape-inst) (:shape-ref shape-main)))))
[shape-main shape-inst components-v2]
(or (= (:shape-ref shape-inst) (:id shape-main))
(and (= (:shape-ref shape-inst) (:shape-ref shape-main))
(not components-v2))))
(defn main-instance?
"Check if this shape is the root of the main instance of some