Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Alejandro Alonso 2023-09-04 11:47:10 +02:00
commit 07562af677
8 changed files with 103 additions and 94 deletions

View file

@ -59,10 +59,11 @@
ptk/WatchEvent
(watch [_ state stream]
(rx/merge
;;fetch teams must be first in case the team doesn't exist
(ptk/watch (du/fetch-teams) state stream)
(ptk/watch (df/load-team-fonts id) state stream)
(ptk/watch (fetch-projects) state stream)
(ptk/watch (fetch-team-members) state stream)
(ptk/watch (du/fetch-teams) state stream)
(ptk/watch (du/fetch-users {:team-id id}) state stream)
(let [stoper (rx/filter (ptk/type? ::finalize) stream)

View file

@ -125,7 +125,7 @@
accepting invitation, or third party auth signup or singin."
[profile]
(letfn [(get-redirect-event []
(let [team-id (:default-team-id profile)
(let [team-id (get-current-team-id profile)
redirect-url (:redirect-url @storage)]
(if (some? redirect-url)
(do
@ -247,7 +247,9 @@
ptk/EffectEvent
(effect [_ _ _]
(reset! storage {})
;; We prefer to keek some stuff in the storage like the current-team-id
(swap! storage dissoc :redirect-url)
(swap! storage dissoc :profile)
(i18n/reset-locale)))))
(defn logout

View file

@ -153,8 +153,10 @@
(hooks/use-shortcuts ::dashboard sc/shortcuts)
(mf/with-effect [team-id]
(st/emit! (dd/initialize {:id team-id}))
(mf/with-effect [profile team-id]
(when profile
;; When doing logout we must avoid reinitializing the dashboard
(st/emit! (dd/initialize {:id team-id})))
(fn []
(dd/finalize {:id team-id})))

View file

@ -230,8 +230,8 @@
]
(mf/with-effect [collapsed]
(when-not collapsed
(mf/with-effect [profile collapsed]
(when (and profile (not collapsed))
(st/emit! (dd/fetch-builtin-templates))))
[:div.dashboard-templates-section