0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

🐛 Fix add svg did not update layout

This commit is contained in:
Eva 2023-01-19 09:55:43 +01:00 committed by Alonso Torres
parent 61e83d7e01
commit 1f9c89fb32

View file

@ -22,6 +22,7 @@
[app.main.data.workspace.selection :as dws]
[app.main.data.workspace.shapes :as dwsh]
[app.main.data.workspace.state-helpers :as wsh]
[app.main.data.workspace.undo :as dwu]
[app.main.repo :as rp]
[app.util.color :as uc]
[app.util.path.parser :as upp]
@ -585,7 +586,11 @@
(filter #(= :add-obj (:type %)))
(map :id)
reverse
vec))]
vec))
undo-id (js/Symbol)]
(rx/of (dch/commit-changes changes)
(dws/select-shapes (d/ordered-set (:id new-shape))))))))
(rx/of (dwu/start-undo-transaction undo-id)
(dch/commit-changes changes)
(dws/select-shapes (d/ordered-set (:id new-shape)))
(ptk/data-event :layout/update [(:id new-shape)])
(dwu/commit-undo-transaction undo-id))))))