mirror of
https://github.com/penpot/penpot.git
synced 2025-07-26 12:27:19 +02:00
♻️ Components refactor: generator for detach-component
This commit is contained in:
parent
7d44eef4ab
commit
0ed582ebc5
2 changed files with 13 additions and 8 deletions
|
@ -554,13 +554,10 @@
|
|||
(watch [it state _]
|
||||
(let [file (wsh/get-local-file state)
|
||||
page-id (get state :current-page-id)
|
||||
container (cfh/get-container file :page page-id)
|
||||
libraries (wsh/get-libraries state)
|
||||
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/with-container container)
|
||||
(pcb/with-objects (:objects container))
|
||||
(cflh/generate-detach-instance container libraries id))]
|
||||
(cflh/generate-detach-component id file page-id libraries))]
|
||||
|
||||
(rx/of (dch/commit-changes changes))))))
|
||||
|
||||
|
@ -597,9 +594,7 @@
|
|||
(reduce
|
||||
(fn [changes id]
|
||||
(cflh/generate-detach-instance changes container libraries id))
|
||||
(-> (pcb/empty-changes it)
|
||||
(pcb/with-container container)
|
||||
(pcb/with-objects objects))
|
||||
(pcb/empty-changes it)
|
||||
selected))]
|
||||
|
||||
(rx/of (when can-detach?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue