mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 12:01:38 +02:00
Simplify images dashboard initialization event impl.
This commit is contained in:
parent
9c5ec0ec9c
commit
81c9794657
1 changed files with 4 additions and 13 deletions
|
@ -30,21 +30,12 @@
|
||||||
(assoc-in [:dashboard :images] data)
|
(assoc-in [:dashboard :images] data)
|
||||||
(assoc-in [:dashboard :section] :dashboard/images))))
|
(assoc-in [:dashboard :section] :dashboard/images))))
|
||||||
|
|
||||||
;; rs/EffectEvent
|
|
||||||
;; (-apply-effect [_ state]
|
|
||||||
;; (when (nil? (:image-colls-by-id state))
|
|
||||||
;; (reset! st/loader true)))
|
|
||||||
|
|
||||||
rs/WatchEvent
|
rs/WatchEvent
|
||||||
(-apply-watch [_ state s]
|
(-apply-watch [_ state s]
|
||||||
(if (nil? (:image-colls-by-id state))
|
(rx/merge
|
||||||
(rx/merge
|
(rx/of (fetch-collections))
|
||||||
(rx/of (fetch-collections))
|
(when (uuid? id)
|
||||||
(->> (rx/filter collections-fetched? s)
|
(rx/of (fetch-images id))))))
|
||||||
(rx/take 1)
|
|
||||||
(rx/do #(reset! st/loader false))
|
|
||||||
(rx/ignore)))
|
|
||||||
(rx/empty))))
|
|
||||||
|
|
||||||
(defn initialize
|
(defn initialize
|
||||||
[type id]
|
[type id]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue