mirror of https://github.com/logseq/logseq
Fix root node block refs when cutting + pasting.
parent
227f3efc85
commit
3aa596f344
|
@ -137,5 +137,7 @@
|
|||
[repo db-id]
|
||||
(when-let [root-block (db/pull db-id)]
|
||||
(let [blocks (db/get-block-and-children repo (:block/uuid root-block))
|
||||
; the root-block returned by db/pull misses :block/_refs therefore we use the one from db/get-block-and-children
|
||||
root-block (first (filter (fn [b] (= (:db/id b) db-id)) blocks))
|
||||
blocks-exclude-root (remove (fn [b] (= (:db/id b) db-id)) blocks)]
|
||||
(sort-blocks blocks-exclude-root root-block))))
|
||||
|
|
Loading…
Reference in New Issue