mirror of
https://github.com/penpot/penpot.git
synced 2025-02-08 16:18:11 -05:00
✨ Remember last team accross logouts and sessions and fix some auth weird stuff
This commit is contained in:
parent
e36b49b4f0
commit
b8179d0e35
5 changed files with 13 additions and 7 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
- Remember last color mode in colorpicker [Taiga #5508](https://tree.taiga.io/project/penpot/issue/5508)
|
- Remember last color mode in colorpicker [Taiga #5508](https://tree.taiga.io/project/penpot/issue/5508)
|
||||||
- Improve layers multiselection behaviour [Github #5741](https://github.com/penpot/penpot/issues/5741)
|
- Improve layers multiselection behaviour [Github #5741](https://github.com/penpot/penpot/issues/5741)
|
||||||
|
- Remember last active team across logouts / sessions [Github #3325](https://github.com/penpot/penpot/issues/3325)
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,11 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(rx/merge
|
(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 (df/load-team-fonts id) state stream)
|
||||||
(ptk/watch (fetch-projects) state stream)
|
(ptk/watch (fetch-projects) state stream)
|
||||||
(ptk/watch (fetch-team-members) 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)
|
(ptk/watch (du/fetch-users {:team-id id}) state stream)
|
||||||
|
|
||||||
(let [stoper (rx/filter (ptk/type? ::finalize) stream)
|
(let [stoper (rx/filter (ptk/type? ::finalize) stream)
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
accepting invitation, or third party auth signup or singin."
|
accepting invitation, or third party auth signup or singin."
|
||||||
[profile]
|
[profile]
|
||||||
(letfn [(get-redirect-event []
|
(letfn [(get-redirect-event []
|
||||||
(let [team-id (:default-team-id profile)
|
(let [team-id (get-current-team-id profile)
|
||||||
redirect-url (:redirect-url @storage)]
|
redirect-url (:redirect-url @storage)]
|
||||||
(if (some? redirect-url)
|
(if (some? redirect-url)
|
||||||
(do
|
(do
|
||||||
|
@ -247,7 +247,9 @@
|
||||||
|
|
||||||
ptk/EffectEvent
|
ptk/EffectEvent
|
||||||
(effect [_ _ _]
|
(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)))))
|
(i18n/reset-locale)))))
|
||||||
|
|
||||||
(defn logout
|
(defn logout
|
||||||
|
|
|
@ -153,8 +153,10 @@
|
||||||
|
|
||||||
(hooks/use-shortcuts ::dashboard sc/shortcuts)
|
(hooks/use-shortcuts ::dashboard sc/shortcuts)
|
||||||
|
|
||||||
(mf/with-effect [team-id]
|
(mf/with-effect [profile team-id]
|
||||||
(st/emit! (dd/initialize {:id team-id}))
|
(when profile
|
||||||
|
;; When doing logout we must avoid reinitializing the dashboard
|
||||||
|
(st/emit! (dd/initialize {:id team-id})))
|
||||||
(fn []
|
(fn []
|
||||||
(dd/finalize {:id team-id})))
|
(dd/finalize {:id team-id})))
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,8 @@
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
(mf/with-effect [collapsed]
|
(mf/with-effect [profile collapsed]
|
||||||
(when-not collapsed
|
(when (and profile (not collapsed))
|
||||||
(st/emit! (dd/fetch-builtin-templates))))
|
(st/emit! (dd/fetch-builtin-templates))))
|
||||||
|
|
||||||
[:div.dashboard-templates-section
|
[:div.dashboard-templates-section
|
||||||
|
|
Loading…
Add table
Reference in a new issue