diff --git a/src/cljs/commiteth/subscriptions.cljs b/src/cljs/commiteth/subscriptions.cljs index 03be998..d7a1818 100644 --- a/src/cljs/commiteth/subscriptions.cljs +++ b/src/cljs/commiteth/subscriptions.cljs @@ -162,6 +162,6 @@ :<- [::open-bounties-sorting-type] (fn [[open-bounties filters sorting-type] _] (cond->> open-bounties - filters (ui-model/filter-bounties filters) + true (ui-model/filter-bounties filters) sorting-type (ui-model/sort-bounties-by-sorting-type sorting-type) - filter vec))) + true vec))) diff --git a/src/cljs/commiteth/ui_model.cljs b/src/cljs/commiteth/ui_model.cljs index fa25f0c..cfa0210 100644 --- a/src/cljs/commiteth/ui_model.cljs +++ b/src/cljs/commiteth/ui_model.cljs @@ -107,15 +107,16 @@ (defn filter-bounties [filters-by-type bounties] (let [filter-preds (->> filters-by-type + ; used `nil?` because a valid filter value can be `false` (remove #(nil? (val %))) (map (fn [[filter-type filter-value]] (let [filter-type-def (bounty-filter-types-def filter-type) pred (::bounty-filter-type.predicate filter-type-def) pre-pred-processor (::bounty-filter-type.pre-predicate-value-processor filter-type-def) filter-value (cond-> filter-value - pre-pred-processor (pre-pred-processor filter-value))] + pre-pred-processor pre-pred-processor)] (partial pred filter-value))))) filters-pred (fn [bounty] (every? #(% bounty) filter-preds))] - (->> bounties - (filter filters-pred)))) + (cond->> bounties + (not-empty filter-preds) (filter filters-pred))))