Minor fix on colors page initialization event.

This commit is contained in:
Andrey Antukh 2016-10-21 16:41:16 +02:00
parent 02c7793050
commit 2764ea0d96

View file

@ -38,18 +38,12 @@
(defrecord Initialize [type id] (defrecord Initialize [type id]
rs/UpdateEvent rs/UpdateEvent
(-apply-update [_ state] (-apply-update [_ state]
(let [type (or type :builtin) (let [type (or type :own)
id (or id (if (= type :builtin) 1 nil))
data {:type type :id id :selected #{}}] data {:type type :id id :selected #{}}]
(-> state (-> state
(assoc-in [:dashboard :colors] data) (assoc-in [:dashboard :colors] data)
(assoc-in [:dashboard :section] :dashboard/colors)))) (assoc-in [:dashboard :section] :dashboard/colors))))
;; rs/EffectEvent
;; (-apply-effect [_ state]
;; (when (nil? (:color-colls-by-id state))
;; (reset! st/loader true)))
rs/WatchEvent rs/WatchEvent
(-apply-watch [_ state s] (-apply-watch [_ state s]
(rx/of (conditional-fetch)))) (rx/of (conditional-fetch))))