Pārlūkot izejas kodu

Fix root node block refs when cutting + pasting.

Tobias Domhan 1 gadu atpakaļ
vecāks
revīzija
3aa596f344
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      src/main/frontend/modules/outliner/tree.cljs

+ 2 - 0
src/main/frontend/modules/outliner/tree.cljs

@@ -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))))