瀏覽代碼

Use new method to get block children

samfundev 5 年之前
父節點
當前提交
49c49e4738
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/main/frontend/components/block.cljs
  2. 2 2
      src/main/frontend/filtering.cljs

+ 1 - 1
src/main/frontend/components/block.cljs

@@ -1933,7 +1933,7 @@
              (ui/foldable
               (page-cp config page)
               (blocks-container blocks config))])))]
-     (blocks-container blocks config))]))
+     (blocks-container blocks config))])
 
 (comment
   ;; timestamps

+ 2 - 2
src/main/frontend/filtering.cljs

@@ -14,7 +14,7 @@
 (defn get-nested-block-references
   [block]
   (let [repo (state/get-current-repo)
-        children (-> (db/get-block-children-unsafe repo (:block/uuid block))
+        children (-> (db/get-block-immediate-children repo (:block/uuid block))
                      db/sort-by-pos)
         child-refs (map get-nested-block-references children)
         block-refs (get-block-references block)]
@@ -27,7 +27,7 @@
 (defn block-matches-filter
   [block filter-state]
   (let [repo (state/get-current-repo)
-        children (-> (db/get-block-children-unsafe repo (:block/uuid block))
+        children (-> (db/get-block-immediate-children repo (:block/uuid block))
                      db/sort-by-pos)
         block-matches (matches-filter (get-block-references block) filter-state)
         child-matches (delay (some #(block-matches-filter % filter-state) children))]