mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-01-11 14:44:35 +00:00
parent
a122621e37
commit
b378cb5f5a
@ -170,15 +170,16 @@
|
||||
(let [new-db (when-not (some #(= filter-input (:query %)) filter-items) ;; prevent duplicate filter strings
|
||||
;; if existing, remove prior filter for :slower-than
|
||||
;; TODO: rework how time filters are used.
|
||||
(when (and (= :slower-than filter-type)
|
||||
(some #(= filter-type (:filter-type %)) filter-items))
|
||||
(remove #(= :slower-than (:filter-type %)) filter-items))
|
||||
;; add new filter
|
||||
(conj filter-items {:id (random-uuid)
|
||||
:query (if (= filter-type :contains)
|
||||
(str/lower-case filter-input)
|
||||
(js/parseFloat filter-input))
|
||||
:filter-type filter-type}))]
|
||||
(let [filter-items (if (and (= :slower-than filter-type)
|
||||
(some #(= filter-type (:filter-type %)) filter-items))
|
||||
(remove #(= :slower-than (:filter-type %)) filter-items)
|
||||
filter-items)]
|
||||
;; add new filter
|
||||
(conj filter-items {:id (random-uuid)
|
||||
:query (if (= filter-type :contains)
|
||||
(str/lower-case filter-input)
|
||||
(js/parseFloat filter-input))
|
||||
:filter-type filter-type})))]
|
||||
(save-filter-items new-db)
|
||||
new-db)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user