浏览代码

fix: editor freezing

related to #4807
Tienson Qin 3 年之前
父节点
当前提交
47445e4834
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/main/frontend/db/model.cljs

+ 5 - 3
src/main/frontend/db/model.cljs

@@ -592,9 +592,11 @@
                                ;; same page, get the most top block before dragging
                                (let [match-ids (set (conj move-blocks target))]
                                  (loop [[id & others] cached-ids]
-                                   (if (contains? match-ids id)
-                                     id
-                                     (recur others))))))
+                                   (if id
+                                     (if (contains? match-ids id)
+                                       id
+                                       (recur others))
+                                     nil)))))
                            (let [insert? (contains? #{:insert-node :insert-nodes :save-and-insert-node} outliner-op)]
                              (some #(when (and (or (and insert? (not (contains? cached-ids-set %)))
                                                    true)