mirror of
https://github.com/penpot/penpot.git
synced 2025-06-13 11:11:41 +02:00
🐛 Fixed paste components from other files
This commit is contained in:
parent
b3abc9fd6a
commit
76b7272a72
1 changed files with 12 additions and 2 deletions
|
@ -1360,7 +1360,17 @@
|
||||||
(d/mapm (fn [_ shape]
|
(d/mapm (fn [_ shape]
|
||||||
(-> shape
|
(-> shape
|
||||||
(assoc :frame-id frame-id)
|
(assoc :frame-id frame-id)
|
||||||
(assoc :parent-id parent-id)))))
|
(assoc :parent-id parent-id)
|
||||||
|
|
||||||
|
(cond->
|
||||||
|
;; Pasting from another file, we deattach components
|
||||||
|
(not= (:current-file-id state) (:file-id data))
|
||||||
|
(dissoc :component-id
|
||||||
|
:component-file
|
||||||
|
:component-root?
|
||||||
|
:remote-synced?
|
||||||
|
:shape-ref
|
||||||
|
:touched))))))
|
||||||
|
|
||||||
page-id (:current-page-id state)
|
page-id (:current-page-id state)
|
||||||
unames (-> (dwc/lookup-page-objects state page-id)
|
unames (-> (dwc/lookup-page-objects state page-id)
|
||||||
|
@ -1394,7 +1404,7 @@
|
||||||
mouse-pos (deref ms/mouse-position)]
|
mouse-pos (deref ms/mouse-position)]
|
||||||
(if (= file-id (:file-id data))
|
(if (= file-id (:file-id data))
|
||||||
(do-paste state mouse-pos [])
|
(do-paste state mouse-pos [])
|
||||||
(->> (rx/from (seq images))
|
(->> (rx/from images)
|
||||||
(rx/merge-map (partial upload-media file-id))
|
(rx/merge-map (partial upload-media file-id))
|
||||||
(rx/reduce conj [])
|
(rx/reduce conj [])
|
||||||
(rx/mapcat (partial do-paste state mouse-pos)))))))))
|
(rx/mapcat (partial do-paste state mouse-pos)))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue