🐛 Remove incorrect find-component function

This commit is contained in:
Pablo Alba 2024-03-07 13:34:22 +01:00 committed by Andrés Moya
parent 5157928cdb
commit 0d1af260a4
4 changed files with 12 additions and 27 deletions

View file

@ -112,7 +112,7 @@
main-instance? (:main-instance root-inst)
libs (wsh/get-libraries state)
component (ctf/find-component libs (:component-id root-inst))
component (ctf/get-component libs (:component-file root-inst) (:component-id root-inst))
library (ctf/get-component-library libs root-inst)
shapes-inst (cfh/get-children-with-self (:objects page) root-inst-id)
@ -152,7 +152,7 @@
root-inst (ctn/get-shape page root-inst-id)
libs (wsh/get-libraries state)
component (ctf/find-component libs (:component-id root-inst))
component (ctf/get-component libs (:component-file root-inst) (:component-id root-inst))
library (ctf/get-component-library libs root-inst)
shapes-inst (cfh/get-children-with-self (:objects page) root-inst-id)
@ -165,9 +165,9 @@
(defn resolve-component
"Get the component with the given id and all its shapes."
[state component-id]
[state component-file component-id]
(let [libs (wsh/get-libraries state)
component (ctf/find-component libs component-id)
component (ctf/get-component libs component-file component-id)
library (ctf/get-component-library libs component)
shapes-main (ctf/get-component-shapes (:data library) component)]

View file

@ -186,9 +186,9 @@
;; Expected shape tree:
;;
;; [Page: Page]
;; Root Frame
;; Root Frame
;; Rect 1 #
;; Rect 1
;; Rect 1
;; Rect 1 #
;; Rect 1* @--> Rect 1
;; Rect 1 ---> Rect 1
@ -362,6 +362,7 @@
component2]
(thl/resolve-component
new-state
(:current-file-id new-state)
new-component-id)]
(t/is (= (:name component2) "Rect 1")))))]
@ -657,7 +658,7 @@
;;
;; [Board]
;; page1 / Board
;;
;;
(let [instance1 (thp/get-shape new-state :instance1)
[[group shape1 shape2]