🐛 Fix logout and login with different accounts show 404 error page

This commit is contained in:
Alejandro Alonso 2023-09-07 11:09:07 +02:00
parent d06124e378
commit 98b1ac7b60

View file

@ -105,9 +105,15 @@
ptk/EffectEvent ptk/EffectEvent
(effect [_ state _] (effect [_ state _]
(when-let [profile (:profile state)] (let [profile (:profile state)
(swap! storage assoc :profile profile) email (:email profile)
(i18n/set-locale! (:lang 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 (defn fetch-profile
[] []
@ -247,9 +253,8 @@
ptk/EffectEvent ptk/EffectEvent
(effect [_ _ _] (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 :redirect-url)
(swap! storage dissoc :profile)
(i18n/reset-locale))))) (i18n/reset-locale)))))
(defn logout (defn logout