From 01cc4d25ae3c90b2f2feeb8a7105eaa3b1fc7cfb Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 9 Jan 2021 11:57:04 +0800 Subject: [PATCH] fix: clear query state so that custom queries will be re-rendered --- src/main/frontend/history.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/history.cljs b/src/main/frontend/history.cljs index c6f0e0ee98..e0011cc67b 100644 --- a/src/main/frontend/history.cljs +++ b/src/main/frontend/history.cljs @@ -7,8 +7,9 @@ ;; Undo && Redo that works with files ;; TODO: -;; 1. undo-tree -;; 2. db-only version, store transactions instead of file patches +;; 1. preserve cursor positions when undo/redo +;; 2. undo-tree +;; 3. db-only version, store transactions instead of file patches ;; repo file -> contents transactions sequence (defonce history (atom {})) @@ -56,6 +57,7 @@ :re-render-root? true})))] (-> (p/all promises) (p/then (fn [] + (db/clear-query-state!) (swap! history-idx assoc repo idx') (reset! *undoing? false)))))))) @@ -76,5 +78,6 @@ :re-render-root? true})))] (-> (p/all promises) (p/then (fn [] + (db/clear-query-state!) (swap! history-idx assoc repo (inc idx)) (reset! *redoing? false))))))))