enhance: improve performance for rendering

Also, simplify the state for expand/collapse.
This commit is contained in:
Tienson Qin
2021-03-29 21:15:03 +08:00
parent a7e867a572
commit 65ce4ec3d9
5 changed files with 39 additions and 80 deletions

View File

@@ -1948,16 +1948,12 @@
(defn expand!
[]
(when-let [current-block (state/get-edit-block)]
(expand/expand! current-block)
(state/set-collapsed-state! (:block/uuid current-block)
false)))
(expand/expand! current-block)))
(defn collapse!
[]
(when-let [current-block (state/get-edit-block)]
(expand/collapse! current-block)
(state/set-collapsed-state! (:block/uuid current-block)
true)))
(expand/collapse! current-block)))
(defn cycle-collapse!
[e]