mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 19:56:38 +02:00
🐛 Fix undo path exit path editor after empty stack
This commit is contained in:
parent
e636dc30c2
commit
1c5d51bf97
1 changed files with 10 additions and 2 deletions
|
@ -9,7 +9,9 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.data.undo-stack :as u]
|
[app.common.data.undo-stack :as u]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
|
[app.main.data.workspace.common :as dwc]
|
||||||
[app.main.data.workspace.path.changes :as changes]
|
[app.main.data.workspace.path.changes :as changes]
|
||||||
|
[app.main.data.workspace.path.common :as common]
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[app.main.store :as store]
|
[app.main.store :as store]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
@ -65,8 +67,14 @@
|
||||||
undo-stack)))))
|
undo-stack)))))
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ state _]
|
||||||
(rx/of (changes/save-path-content {:preserve-move-to true})))))
|
(let [id (st/get-path-id state)
|
||||||
|
undo-stack (get-in state [:workspace-local :edit-path id :undo-stack])]
|
||||||
|
(if (> (:index undo-stack) 0)
|
||||||
|
(rx/of (changes/save-path-content {:preserve-move-to true}))
|
||||||
|
(rx/of (changes/save-path-content {:preserve-move-to true})
|
||||||
|
(common/finish-path)
|
||||||
|
(dwc/show-toolbar)))))))
|
||||||
|
|
||||||
(defn redo-path []
|
(defn redo-path []
|
||||||
(ptk/reify ::redo-path
|
(ptk/reify ::redo-path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue