0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

Merge pull request #3604 from penpot/superalex-fix-log-out-log-in-with-different-acounts-page-not-exist

🐛 Fix logout and login with different accounts show 404 error page
This commit is contained in:
Andrey Antukh 2023-09-07 11:22:17 +02:00 committed by GitHub
commit 3fea366a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,9 +105,15 @@
ptk/EffectEvent
(effect [_ state _]
(when-let [profile (:profile state)]
(swap! storage assoc :profile profile)
(i18n/set-locale! (:lang profile))))))
(let [profile (:profile state)
email (:email profile)
previous-profile (:profile @storage)
previous-email (:email previous-profile)]
(when profile
(swap! storage assoc :profile profile)
(i18n/set-locale! (:lang profile))
(when (not= previous-email email)
(swap! storage dissoc ::current-team-id)))))))
(defn fetch-profile
[]
@ -247,9 +253,8 @@
ptk/EffectEvent
(effect [_ _ _]
;; We prefer to keek some stuff in the storage like the current-team-id
;; We prefer to keek some stuff in the storage like the current-team-id and the profile
(swap! storage dissoc :redirect-url)
(swap! storage dissoc :profile)
(i18n/reset-locale)))))
(defn logout