mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 21:01:38 +02:00
🐛 Fix incorrect profile refresh after onboarding end step
and many other setting screens
This commit is contained in:
parent
579a5729e6
commit
ca743cc7cb
7 changed files with 48 additions and 45 deletions
|
@ -55,23 +55,6 @@
|
|||
[]
|
||||
(mf/render! app-root (mf/element ui/app)))
|
||||
|
||||
(defn- initialize-profile
|
||||
"Event used mainly on application bootstrap; it fetches the profile
|
||||
and if and only if the fetched profile corresponds to an
|
||||
authenticated user; proceed to fetch teams."
|
||||
[stream]
|
||||
(rx/merge
|
||||
(rx/of (dp/fetch-profile))
|
||||
(->> stream
|
||||
(rx/filter dp/profile-fetched?)
|
||||
(rx/take 1)
|
||||
(rx/map deref)
|
||||
(rx/mapcat (fn [profile]
|
||||
(if (dp/is-authenticated? profile)
|
||||
(rx/of (dp/initialize-profile profile))
|
||||
(rx/empty))))
|
||||
(rx/observe-on :async))))
|
||||
|
||||
(defn initialize
|
||||
[]
|
||||
(ptk/reify ::initialize
|
||||
|
@ -83,9 +66,8 @@
|
|||
(watch [_ _ stream]
|
||||
(rx/merge
|
||||
(rx/of (ev/initialize)
|
||||
(feat/initialize))
|
||||
|
||||
(initialize-profile stream)
|
||||
(feat/initialize)
|
||||
(dp/refresh-profile))
|
||||
|
||||
;; Watch for profile deletion events
|
||||
(->> stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue