Skip to content

Commit

Permalink
fix: count in same page
Browse files Browse the repository at this point in the history
  • Loading branch information
Weihua Lu authored and tiensonqin committed May 18, 2021
1 parent de85570 commit bf2319b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/frontend/components/reference.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
(->> (group-by second filter-state)
(medley/map-vals #(map first %))))
filtered-ref-blocks (block-handler/filter-blocks repo ref-blocks filters true)
n-ref (count filtered-ref-blocks)]
n-ref (apply +
(for [[_ rfs] filtered-ref-blocks]
(count rfs)))]
(when (or (> n-ref 0)
(seq scheduled-or-deadlines)
(seq filter-state))
Expand Down Expand Up @@ -135,7 +137,10 @@
< rum/reactive db-mixins/query
[state page-name n-ref]
(let [ref-blocks (db/get-page-unlinked-references page-name)]
(when (nil? @n-ref) (reset! n-ref (count ref-blocks)))
(when (nil? @n-ref) (reset! n-ref
(apply +
(for [[_ rfs] ref-blocks]
(count rfs)))))
[:div.references-blocks
(let [ref-hiccup (block/->hiccup ref-blocks
{:id (str page-name "-unlinked-")
Expand Down

0 comments on commit bf2319b

Please sign in to comment.