0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

🐛 Fix validation

This commit is contained in:
Andrés Moya 2023-09-21 11:12:00 +02:00
parent 1ab690a408
commit 1fa8888bf3
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@
(report-error :component-main-external
(str/format "Main instance should refer to a component in the same file")
shape file page))
(let [component (ctf/resolve-component shape file libraries {:include-deleted? true})]
(let [component (ctf/resolve-component shape file libraries :include-deleted? true)]
(if (nil? component)
(report-error :component-not-found
(str/format "Component %s not found in file" (:component-id shape) (:component-file shape))

View file

@ -126,10 +126,10 @@
(defn resolve-component
"Retrieve the referenced component, from the local file or from a library"
[shape file libraries & params]
[shape file libraries & {:keys [include-deleted?] :or {include-deleted? false}}]
(if (= (:component-file shape) (:id file))
(ctkl/get-component (:data file) (:component-id shape) params)
(get-component libraries (:component-file shape) (:component-id shape) params)))
(ctkl/get-component (:data file) (:component-id shape) include-deleted?)
(get-component libraries (:component-file shape) (:component-id shape) :include-deleted? include-deleted?)))
(defn get-component-library
"Retrieve the library the component belongs to."