From 9e9d0f6d4d9a4e5e0fc09451b7dac651b46ea223 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Wed, 31 Jan 2018 17:48:26 +0200 Subject: [PATCH] Change dropdown component: remove doall, use into instead of conj --- src/cljs/commiteth/common.cljs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cljs/commiteth/common.cljs b/src/cljs/commiteth/common.cljs index a613925..0b0898f 100644 --- a/src/cljs/commiteth/common.cljs +++ b/src/cljs/commiteth/common.cljs @@ -15,21 +15,21 @@ "If val-ratom is set, preselect it in the dropdown. Add value of val-ratom if it's missing from items list. Otherwise, prepend title as a disabled option" - (let [items (cond-> items + (let [items (cond->> items (and @val-ratom (not (contains? (set items) @val-ratom))) - (conj @val-ratom) + (into [@val-ratom]) (not @val-ratom) - (conj title))] + (into [title]))] (fn [] [:select.ui.basic.selection.dropdown (merge props {:on-change #(reset! val-ratom (-> % .-target .-value)) :default-value (or @val-ratom title)}) - (doall (for [item items] + (for [item items] ^{:key item} [:option {:value item :disabled (= item title)} - item]))]))) + item])]))) (defn moment-timestamp [time] (let [now (.now js/Date.)