Commit b8b244d9 authored by Ricardo J. Mendez's avatar Ricardo J. Mendez

Removing unnecessary threading macros

parent 55545802
......@@ -77,8 +77,7 @@
the result."
[url]
(if (not-empty url)
(let [element (-> (dommy/create-element :a)
(dommy/set-attr! :href url))
(let [element (dommy/set-attr! (dommy/create-element :a) :href url)
shortened (str (.toLowerCase (.-host element)) (.-pathname element) (.-search element))]
(hash-string shortened))
0))
......
......@@ -182,7 +182,7 @@
(let [modal-info (subscribe [:ui-state :modal-info])
;; On the next one, we can't use not-empty because (= nil (not-empty nil)), and :show expects true/false,
;; not a truth-ish value.
show? (reaction (not (empty? @modal-info)))]
show? (reaction (seq @modal-info))]
(fn []
[Modal {:show @show? :onHide #(dispatch [:modal-info-set nil])}
[ModalHeader
......@@ -201,8 +201,6 @@
(defn list-urls [urls site-data]
(let [now (.now js/Date)]
(->>
urls
(map-indexed
(fn [i tab]
(let [url (:url tab)
......@@ -246,7 +244,8 @@
:style {:color "red"}
:on-click #(runtime/send-message {:action :delete-url
:data url})}]]]
]))))))
]))
urls)))
(defn div-urltimes []
......@@ -306,8 +305,6 @@
[:th "Time"]
[:th "Site"]]]
[:tbody
(->>
@to-list
(map-indexed
(fn [i site]
(let [url (:host site)
......@@ -320,7 +317,8 @@
:width 16
:height 16}])
url]
]))))]
]))
@to-list)]
]]]])
))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment