Problems with discover updates (#778)
This commit is contained in:
parent
f930f9e127
commit
4bd800f5ca
|
@ -28,12 +28,13 @@
|
||||||
(fn [db [_ limit tags]]
|
(fn [db [_ limit tags]]
|
||||||
(let [discoveries (reaction (:discoveries @db))
|
(let [discoveries (reaction (:discoveries @db))
|
||||||
current-tag (reaction (:current-tag @db))
|
current-tag (reaction (:current-tag @db))
|
||||||
search-tags (reaction (:discover-search-tags @db))
|
search-tags (reaction (:discover-search-tags @db))]
|
||||||
discoveries (->> (get-discoveries-by-tags @discoveries @current-tag (or tags @search-tags))
|
(reaction
|
||||||
(map #(assoc % :priority (calculate-priority db %)))
|
(let [discoveries (->> (get-discoveries-by-tags @discoveries @current-tag (or tags @search-tags))
|
||||||
(sort-by :priority >))]
|
(map #(assoc % :priority (calculate-priority @db %)))
|
||||||
(reaction {:discoveries (take limit discoveries)
|
(sort-by :priority >))]
|
||||||
:total (count discoveries)}))))
|
{:discoveries (take limit discoveries)
|
||||||
|
:total (count discoveries)})))))
|
||||||
|
|
||||||
(register-sub :get-recent-discoveries
|
(register-sub :get-recent-discoveries
|
||||||
(fn [db]
|
(fn [db]
|
||||||
|
|
Loading…
Reference in New Issue