fix: selection can failed

This commit is contained in:
Tienson Qin
2021-07-21 21:51:25 +08:00
parent 99b2989c66
commit dfa06204ae
2 changed files with 7 additions and 2 deletions

View File

@@ -602,12 +602,13 @@
(dom/add-class! block "selected noselect")
(swap! state assoc
:selection/mode true
:selection/blocks (conj (:selection/blocks @state) block)
:selection/blocks (conj (vec (:selection/blocks @state)) block)
:selection/direction direction))
(defn drop-last-selection-block!
[]
(let [last-block (peek (:selection/blocks @state))]
(def blocks (:selection/blocks @state))
(let [last-block (peek (vec (:selection/blocks @state)))]
(swap! state assoc
:selection/mode true
:selection/blocks (vec (pop (:selection/blocks @state))))