mirror of https://github.com/logseq/logseq
fix: redo
parent
674c787f46
commit
8b9c3e249e
|
@ -36,10 +36,12 @@
|
|||
|
||||
(defn will-unmount
|
||||
[state]
|
||||
(let [{:keys [value block] :as state} (editor-handler/get-state)]
|
||||
(let [{:keys [value block] :as state} (editor-handler/get-state)
|
||||
editor-op (state/get-editor-op)]
|
||||
(editor-handler/clear-when-saved!)
|
||||
(state/set-editor-op! nil)
|
||||
(when (db/entity [:block/uuid (:block/uuid block)]) ; block still exists
|
||||
(when-not (or (contains? #{:undo :redo} (state/get-editor-op))
|
||||
(when-not (or (contains? #{:undo :redo} editor-op)
|
||||
(state/editor-in-composition?))
|
||||
(editor-handler/save-block! state value))))
|
||||
state)
|
||||
|
|
|
@ -158,8 +158,7 @@
|
|||
|
||||
(when (= :rename-page (:outliner-op tx-meta))
|
||||
(when-let [old-page (:old-name (:data tx-meta))]
|
||||
(route-handler/redirect-to-page! old-page)))
|
||||
(util/schedule #(state/set-editor-op! nil)))
|
||||
(route-handler/redirect-to-page! old-page))))
|
||||
(assoc e
|
||||
:txs-op new-txs
|
||||
:editor-cursor editor-cursor))))
|
||||
|
@ -180,9 +179,7 @@
|
|||
|
||||
(when (= :rename-page (:outliner-op tx-meta))
|
||||
(when-let [new-page (:new-name (:data tx-meta))]
|
||||
(route-handler/redirect-to-page! new-page)))
|
||||
|
||||
(util/schedule #(state/set-editor-op! :nil)))
|
||||
(route-handler/redirect-to-page! new-page))))
|
||||
|
||||
(assoc e
|
||||
:txs-op new-txs
|
||||
|
|
Loading…
Reference in New Issue