🐛 Fix undo problem when changing typography/color

This commit is contained in:
alonso.torres 2021-10-05 10:45:02 +02:00
parent a052bfd2fa
commit 013f56347d
2 changed files with 10 additions and 4 deletions

View file

@ -13,6 +13,7 @@
- Fix problem with overflow dropdown on stroke-cap [#1216](https://github.com/penpot/penpot/issues/1216) - Fix problem with overflow dropdown on stroke-cap [#1216](https://github.com/penpot/penpot/issues/1216)
- Fix menu context for single element nested in components [#1186](https://github.com/penpot/penpot/issues/1186) - Fix menu context for single element nested in components [#1186](https://github.com/penpot/penpot/issues/1186)
- Fix error screen when operations over comments fail [#1219](https://github.com/penpot/penpot/issues/1219) - Fix error screen when operations over comments fail [#1219](https://github.com/penpot/penpot/issues/1219)
- Fix undo problem when changing typography/color from library [#1230](https://github.com/penpot/penpot/issues/1230)
### :arrow_up: Deps updates ### :arrow_up: Deps updates
### :boom: Breaking changes ### :boom: Breaking changes

View file

@ -19,6 +19,7 @@
[app.main.data.workspace.groups :as dwg] [app.main.data.workspace.groups :as dwg]
[app.main.data.workspace.libraries-helpers :as dwlh] [app.main.data.workspace.libraries-helpers :as dwlh]
[app.main.data.workspace.state-helpers :as wsh] [app.main.data.workspace.state-helpers :as wsh]
[app.main.data.workspace.undo :as dwu]
[app.main.repo :as rp] [app.main.repo :as rp]
[app.main.store :as st] [app.main.store :as st]
[app.util.i18n :refer [tr]] [app.util.i18n :refer [tr]]
@ -134,10 +135,12 @@
:color color} :color color}
uchg {:type :mod-color uchg {:type :mod-color
:color prev}] :color prev}]
(rx/of (dch/commit-changes {:redo-changes [rchg] (rx/of (dwu/start-undo-transaction)
(dch/commit-changes {:redo-changes [rchg]
:undo-changes [uchg] :undo-changes [uchg]
:origin it}) :origin it})
(sync-file (:current-file-id state) file-id)))))) (sync-file (:current-file-id state) file-id)
(dwu/commit-undo-transaction))))))
(defn delete-color (defn delete-color
[{:keys [id] :as params}] [{:keys [id] :as params}]
@ -244,10 +247,12 @@
:typography typography} :typography typography}
uchg {:type :mod-typography uchg {:type :mod-typography
:typography prev}] :typography prev}]
(rx/of (dch/commit-changes {:redo-changes [rchg] (rx/of (dwu/start-undo-transaction)
(dch/commit-changes {:redo-changes [rchg]
:undo-changes [uchg] :undo-changes [uchg]
:origin it}) :origin it})
(sync-file (:current-file-id state) file-id)))))) (sync-file (:current-file-id state) file-id)
(dwu/commit-undo-transaction))))))
(defn delete-typography (defn delete-typography
[id] [id]