0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix undo for set typography

This commit is contained in:
alonso.torres 2024-03-07 11:27:29 +01:00
parent 0db24dc7ec
commit b9b85b5ada

View file

@ -601,12 +601,16 @@
attrs (-> typography
(assoc :typography-ref-file file-id)
(assoc :typography-ref-id (:id typography))
(dissoc :id :name))]
(dissoc :id :name))
undo-id (js/Symbol)]
(->> (rx/from (seq selected))
(rx/map (fn [id]
(let [editor (get editor-state id)]
(update-text-attrs {:id id :editor editor :attrs attrs})))))))))
(rx/concat
(rx/of (dwu/start-undo-transaction undo-id))
(->> (rx/from (seq selected))
(rx/map (fn [id]
(let [editor (get editor-state id)]
(update-text-attrs {:id id :editor editor :attrs attrs})))))
(rx/of (dwu/commit-undo-transaction undo-id)))))))
(defn generate-typography-name
[{:keys [font-id font-variant-id] :as typography}]