fix: only insert a new block when the previous insert op is finished

This commit is contained in:
Tienson Qin
2020-11-12 12:46:28 +08:00
parent 6794aada93
commit dbe9e20165

View File

@@ -752,8 +752,10 @@
(defn insert-new-block!
[state]
(state/set-editor-op! :insert)
(when-not config/publishing?
(when (and (not config/publishing?)
;; wait for the previous insert op finished
(not= :insert (state/get-editor-op)))
(state/set-editor-op! :insert)
(let [{:keys [block value format id config]} (get-state state)
block-id (:block/uuid block)
block (or (db/pull [:block/uuid block-id])