fix: can't move blocks up

Fixes LOG-3140
pull/11311/head
Tienson Qin 2024-05-09 04:07:55 +08:00
parent d3c276ac50
commit d6ffd16799
1 changed files with 3 additions and 2 deletions

View File

@ -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?]