Prevent duplicate filter strings

This commit is contained in:
Saskia Lindner 2017-08-31 13:55:22 +02:00 committed by Daniel Compton
parent 51069d5eb7
commit 562a8c7322
1 changed files with 6 additions and 5 deletions

View File

@ -147,11 +147,12 @@
(< (:query query) (:duration trace)))))
(defn add-filter [filter-items filter-input filter-type]
(swap! filter-items conj {:id (random-uuid)
:query (if (= filter-type :contains)
(str/lower-case filter-input)
(js/parseFloat filter-input))
:filter-type filter-type}))
(if-not (some #(= filter-input (:query %)) @filter-items)
(swap! filter-items conj {:id (random-uuid)
:query (if (= filter-type :contains)
(str/lower-case filter-input)
(js/parseFloat filter-input))
:filter-type filter-type})))
(defn render-traces [showing-traces filter-items filter-input trace-detail-expansions]
(doall