mirror of
https://github.com/penpot/penpot.git
synced 2026-07-22 22:17:58 +00:00
Simplify projects initialize event.
This commit is contained in:
parent
0b6450e78a
commit
1530464432
@ -41,22 +41,9 @@
|
||||
(-apply-update [_ state]
|
||||
(assoc-in state [:dashboard :section] :dashboard/projects))
|
||||
|
||||
rs/EffectEvent
|
||||
(-apply-effect [_ state]
|
||||
(when-not (seq (:projects-by-id state))
|
||||
(reset! st/loader true)))
|
||||
|
||||
rs/WatchEvent
|
||||
(-apply-watch [_ state s]
|
||||
(let [projects (seq (:projects-by-id state))]
|
||||
(if projects
|
||||
(rx/empty)
|
||||
(rx/merge
|
||||
(rx/of (fetch-projects))
|
||||
(->> (rx/filter projects-fetched? s)
|
||||
(rx/take 1)
|
||||
(rx/do #(reset! st/loader false))
|
||||
(rx/ignore)))))))
|
||||
(rx/of (fetch-projects))))
|
||||
|
||||
(defn initialize
|
||||
[]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user