mirror of
https://github.com/penpot/penpot.git
synced 2025-06-01 04:11:41 +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 :section] :dashboard/images))))
|
||||
|
||||
;; rs/EffectEvent
|
||||
;; (-apply-effect [_ state]
|
||||
;; (when (nil? (:image-colls-by-id state))
|
||||
;; (reset! st/loader true)))
|
||||
|
||||
rs/WatchEvent
|
||||
(-apply-watch [_ state s]
|
||||
(if (nil? (:image-colls-by-id state))
|
||||
(rx/merge
|
||||
(rx/of (fetch-collections))
|
||||
(->> (rx/filter collections-fetched? s)
|
||||
(rx/take 1)
|
||||
(rx/do #(reset! st/loader false))
|
||||
(rx/ignore)))
|
||||
(rx/empty))))
|
||||
(rx/merge
|
||||
(rx/of (fetch-collections))
|
||||
(when (uuid? id)
|
||||
(rx/of (fetch-images id))))))
|
||||
|
||||
(defn initialize
|
||||
[type id]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue