0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🐛 Fix problem when creating a component with empty data

This commit is contained in:
alonso.torres 2021-05-26 16:12:29 +02:00
parent 6710d99878
commit 0de8bfeba6

View file

@ -264,13 +264,14 @@
objects (wsh/lookup-page-objects state page-id) objects (wsh/lookup-page-objects state page-id)
selected (wsh/lookup-selected state) selected (wsh/lookup-selected state)
selected (cp/clean-loops objects selected)] selected (cp/clean-loops objects selected)]
(let [[group rchanges uchanges] (when-not (empty? selected)
(dwlh/generate-add-component selected objects page-id file-id)] (let [[group rchanges uchanges]
(when-not (empty? rchanges) (dwlh/generate-add-component selected objects page-id file-id)]
(rx/of (dch/commit-changes {:redo-changes rchanges (when-not (empty? rchanges)
:undo-changes uchanges (rx/of (dch/commit-changes {:redo-changes rchanges
:origin it}) :undo-changes uchanges
(dwc/select-shapes (d/ordered-set (:id group)))))))))) :origin it})
(dwc/select-shapes (d/ordered-set (:id group)))))))))))
(defn rename-component (defn rename-component
"Rename the component with the given id, in the current file library." "Rename the component with the given id, in the current file library."