feat: limit the scope of undo/redo to page only

This commit is contained in:
Tienson Qin
2023-04-06 20:41:31 +08:00
parent 593526f578
commit 68691467de
4 changed files with 91 additions and 4 deletions

View File

@@ -275,7 +275,9 @@
:whiteboard/onboarding-whiteboard? (or (storage/get :ls-onboarding-whiteboard?) false)
:whiteboard/onboarding-tour? (or (storage/get :whiteboard-onboarding-tour?) false)
:whiteboard/last-persisted-at {}
:whiteboard/pending-tx-data {}})))
:whiteboard/pending-tx-data {}
:history/page-only-mode? false
:history/page nil})))
;; Block ast state
;; ===============
@@ -2093,3 +2095,13 @@ Similar to re-frame subscriptions"
(defn clear-user-info!
[]
(storage/remove :user-groups))
(defn toggle-undo-redo-mode!
[]
(if (:history/page-only-mode? @state)
(swap! state assoc
:history/page-only-mode? false
:history/page nil)
(swap! state assoc
:history/page-only-mode? true
:history/page nil)))