From 4bd800f5ca34453a1d50599feb4fa18e086684ff Mon Sep 17 00:00:00 2001 From: alwx Date: Thu, 16 Feb 2017 13:10:22 +0300 Subject: [PATCH] Problems with discover updates (#778) --- src/status_im/discover/subs.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/status_im/discover/subs.cljs b/src/status_im/discover/subs.cljs index 734aa01eab..178d5b8fb0 100644 --- a/src/status_im/discover/subs.cljs +++ b/src/status_im/discover/subs.cljs @@ -28,12 +28,13 @@ (fn [db [_ limit tags]] (let [discoveries (reaction (:discoveries @db)) current-tag (reaction (:current-tag @db)) - search-tags (reaction (:discover-search-tags @db)) - discoveries (->> (get-discoveries-by-tags @discoveries @current-tag (or tags @search-tags)) - (map #(assoc % :priority (calculate-priority db %))) - (sort-by :priority >))] - (reaction {:discoveries (take limit discoveries) - :total (count discoveries)})))) + search-tags (reaction (:discover-search-tags @db))] + (reaction + (let [discoveries (->> (get-discoveries-by-tags @discoveries @current-tag (or tags @search-tags)) + (map #(assoc % :priority (calculate-priority @db %))) + (sort-by :priority >))] + {:discoveries (take limit discoveries) + :total (count discoveries)}))))) (register-sub :get-recent-discoveries (fn [db]