🐛 Fix incorrect profile refresh after onboarding end step

and many other setting screens
This commit is contained in:
Andrey Antukh 2024-12-11 15:20:39 +01:00
parent 579a5729e6
commit ca743cc7cb
7 changed files with 48 additions and 45 deletions

View file

@ -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