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:
parent
0db24dc7ec
commit
b9b85b5ada
1 changed files with 9 additions and 5 deletions
|
@ -601,12 +601,16 @@
|
||||||
attrs (-> typography
|
attrs (-> typography
|
||||||
(assoc :typography-ref-file file-id)
|
(assoc :typography-ref-file file-id)
|
||||||
(assoc :typography-ref-id (:id typography))
|
(assoc :typography-ref-id (:id typography))
|
||||||
(dissoc :id :name))]
|
(dissoc :id :name))
|
||||||
|
undo-id (js/Symbol)]
|
||||||
|
|
||||||
(->> (rx/from (seq selected))
|
(rx/concat
|
||||||
(rx/map (fn [id]
|
(rx/of (dwu/start-undo-transaction undo-id))
|
||||||
(let [editor (get editor-state id)]
|
(->> (rx/from (seq selected))
|
||||||
(update-text-attrs {:id id :editor editor :attrs attrs})))))))))
|
(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
|
(defn generate-typography-name
|
||||||
[{:keys [font-id font-variant-id] :as typography}]
|
[{:keys [font-id font-variant-id] :as typography}]
|
||||||
|
|
Loading…
Reference in a new issue