瀏覽代碼

fix: can't move blocks up

Fixes LOG-3140
Tienson Qin 1 年之前
父節點
當前提交
d6ffd16799
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      deps/outliner/src/logseq/outliner/core.cljs

+ 3 - 2
deps/outliner/src/logseq/outliner/core.cljs

@@ -724,11 +724,12 @@
 
 (defn- move-to-original-position?
   [blocks target-block sibling? non-consecutive-blocks?]
-  (let [block (first blocks)]
+  (let [block (first blocks)
+        db (.-db target-block)]
     (and (not non-consecutive-blocks?)
          (if sibling?
            (= (:db/id (ldb/get-left-sibling block)) (:db/id target-block))
-           (= (:db/id (:block/parent block)) (:db/id target-block))))))
+           (= (ldb/get-first-child db (:db/id target-block)) (:db/id block))))))
 
 (defn- move-block
   [conn block target-block sibling?]