Tienson Qin 2 лет назад
Родитель
Сommit
b2afb5b861
2 измененных файлов с 2 добавлено и 21 удалено
  1. 2 2
      src/main/frontend/db.cljs
  2. 0 19
      src/main/frontend/db/model.cljs

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

@@ -29,8 +29,8 @@
   entity pull pull-many transact! get-key-value]
 
  [frontend.db.model
-  blocks-count blocks-count-cache delete-blocks get-pre-block
-  delete-files delete-pages-by-files get-all-block-contents get-all-block-avets get-all-tagged-pages get-single-block-contents
+  delete-blocks get-pre-block
+  delete-files delete-pages-by-files get-all-block-contents get-all-tagged-pages get-single-block-contents
   get-all-templates get-block-and-children get-block-by-uuid get-block-children sort-by-left
   get-block-parent get-block-parents parents-collapsed? get-block-referenced-blocks get-all-referenced-blocks-uuid
   get-block-immediate-children get-block-page

+ 0 - 19
src/main/frontend/db/model.cljs

@@ -1313,19 +1313,6 @@ independent of format as format specific heading characters are stripped"
          (sort-by :block/name)
          (first))))
 
-(defonce blocks-count-cache (atom nil))
-
-(defn blocks-count
-  ([]
-   (blocks-count true))
-  ([cache?]
-   (if (and cache? @blocks-count-cache)
-     @blocks-count-cache
-     (when-let [db (conn/get-db)]
-       (let [n (count (d/datoms db :avet :block/uuid))]
-         (reset! blocks-count-cache n)
-         n)))))
-
 (defn get-all-referenced-blocks-uuid
   "Get all uuids of blocks with any back link exists."
   []
@@ -1356,12 +1343,6 @@ independent of format as format specific heading characters are stripped"
          (map get-single-block-contents)
          (remove nil?))))
 
-(defn get-all-block-avets
-  []
-  (when-let [db (conn/get-db)]
-    (->> (d/datoms db :avet :block/uuid))))
-
-;; Deprecated?
 (defn delete-blocks
   [repo-url files _delete-page?]
   (when (seq files)