mirror of https://github.com/logseq/logseq
fix: refresh root ui after undo or redo
parent
bc034768c1
commit
9789996e8c
|
@ -150,8 +150,6 @@
|
|||
re-render-root? false
|
||||
add-history? true
|
||||
update-status? false}}]
|
||||
(prn "alter file:" {:editor/pos (state/get-edit-pos)
|
||||
:editor/block (state/get-edit-block)})
|
||||
(let [edit-block (state/get-edit-block)
|
||||
original-content (db/get-file-no-sub repo path)]
|
||||
(if reset?
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
[frontend.history :as history]
|
||||
[frontend.handler.file :as file]
|
||||
[frontend.handler.editor :as editor]
|
||||
[frontend.handler.ui :as ui-handler]
|
||||
[promesa.core :as p]
|
||||
[clojure.core.async :as async]
|
||||
[goog.dom :as gdom]
|
||||
|
@ -22,6 +23,7 @@
|
|||
|
||||
(defn restore-cursor!
|
||||
[{:keys [block-container block-idx pos] :as state}]
|
||||
(ui-handler/re-render-root!)
|
||||
;; get the element
|
||||
(when (and block-container block-idx pos)
|
||||
(when-let [container (gdom/getElement block-container)]
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
;; restore cursor
|
||||
(when (> idx' 0)
|
||||
(let [prev-tx (get-in @history [repo (dec idx')])]
|
||||
(prn {:prev-tx prev-tx})
|
||||
(when restore-cursor (restore-cursor prev-tx)))))))))))
|
||||
|
||||
(defonce *redoing? (atom false))
|
||||
|
@ -108,6 +107,7 @@
|
|||
:re-render-root? true})))]
|
||||
(-> (p/all promises)
|
||||
(p/then (fn []
|
||||
(db/clear-query-state!)
|
||||
(swap! history-idx assoc repo (inc idx))
|
||||
(reset! *redoing? false)
|
||||
;; restore cursor
|
||||
|
|
Loading…
Reference in New Issue