0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-14 07:51:35 -05:00

🐛 Fix undo when deleting shapes inside instances

This commit is contained in:
Andrés Moya 2023-05-12 16:20:48 +02:00
parent 58a6f437c4
commit c421059e97

View file

@ -208,10 +208,14 @@
(recur (rest ids-seq)
(conj ids-to-delete id)
ids-to-hide)))))
[ids []])]
[ids []])
undo-id (js/Symbol)]
(rx/concat (rx/of (update-shape-flags ids-to-hide {:hidden true}))
(real-delete-shapes file page objects ids-to-delete it components-v2)))))))
(rx/of (dwu/start-undo-transaction undo-id)
(update-shape-flags ids-to-hide {:hidden true})
(real-delete-shapes file page objects ids-to-delete it components-v2)
(dwu/commit-undo-transaction undo-id)))))))
(defn- real-delete-shapes
[file page objects ids it components-v2]
@ -331,14 +335,11 @@
(cond-> (seq starting-flows)
(pcb/update-page-option :flows (fn [flows]
(->> (map :id starting-flows)
(reduce ctp/remove-flow flows))))))
undo-id (js/Symbol)]
(reduce ctp/remove-flow flows))))))]
(rx/of (dwu/start-undo-transaction undo-id)
(dc/detach-comment-thread ids)
(rx/of (dc/detach-comment-thread ids)
(ptk/data-event :layout/update all-parents)
(dch/commit-changes changes)
(dwu/commit-undo-transaction undo-id))))
(dch/commit-changes changes))))
(defn create-and-add-shape
[type frame-x frame-y data]