mirror of
https://github.com/penpot/penpot.git
synced 2025-05-06 23:25:53 +02:00
🐛 Fix restore remote component
This commit is contained in:
parent
1b0848389c
commit
e8dde477a5
1 changed files with 4 additions and 6 deletions
|
@ -464,14 +464,13 @@
|
||||||
(update-in [parent-id :shapes]
|
(update-in [parent-id :shapes]
|
||||||
#(conj % (:id shape))))
|
#(conj % (:id shape))))
|
||||||
|
|
||||||
|
|
||||||
;; Adds a resize-parents operation so the groups are updated. We add all the new objects
|
;; Adds a resize-parents operation so the groups are updated. We add all the new objects
|
||||||
new-objects-ids (->> changes :redo-changes (filter #(= (:type %) :add-obj)) (mapv :id))
|
new-objects-ids (->> changes :redo-changes (filter #(= (:type %) :add-obj)) (mapv :id))
|
||||||
changes (-> changes
|
changes (-> changes
|
||||||
(pcb/with-objects objects)
|
(pcb/with-objects objects)
|
||||||
(pcb/resize-parents new-objects-ids))]
|
(pcb/resize-parents new-objects-ids))]
|
||||||
(rx/of (dch/commit-changes changes))))))
|
|
||||||
|
|
||||||
|
(rx/of (dch/commit-changes (assoc changes :file-id library-id)))))))
|
||||||
|
|
||||||
(defn instantiate-component
|
(defn instantiate-component
|
||||||
"Create a new shape in the current page, from the component with the given id
|
"Create a new shape in the current page, from the component with the given id
|
||||||
|
@ -480,7 +479,6 @@
|
||||||
(dm/assert! (uuid? file-id))
|
(dm/assert! (uuid? file-id))
|
||||||
(dm/assert! (uuid? component-id))
|
(dm/assert! (uuid? component-id))
|
||||||
(dm/assert! (gpt/point? position))
|
(dm/assert! (gpt/point? position))
|
||||||
|
|
||||||
(ptk/reify ::instantiate-component
|
(ptk/reify ::instantiate-component
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
|
|
Loading…
Add table
Reference in a new issue