mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
🐛 Fix unexpected exception after logout.
This commit is contained in:
parent
5d1b358179
commit
35e50dc47c
3 changed files with 6 additions and 21 deletions
|
@ -64,7 +64,7 @@
|
|||
(ptk/reify ::clear-user-data
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(merge state (dissoc initial-state :route :router)))
|
||||
(select-keys state [:route :router :session-id]))
|
||||
|
||||
ptk/WatchEvent
|
||||
(watch [_ state s]
|
||||
|
@ -79,7 +79,7 @@
|
|||
(def logout
|
||||
(ptk/reify ::logout
|
||||
ptk/WatchEvent
|
||||
(watch [_ state s]
|
||||
(watch [_ state stream]
|
||||
(rx/of (rt/nav :login)
|
||||
clear-user-data))))
|
||||
|
||||
|
|
|
@ -54,24 +54,9 @@
|
|||
nil))
|
||||
|
||||
(def initial-state
|
||||
{:route nil
|
||||
:router nil
|
||||
:session-id (uuid/next)
|
||||
:auth (:auth storage)
|
||||
:profile (:profile storage)
|
||||
:clipboard #queue []
|
||||
:undo {}
|
||||
:workspace-layout nil
|
||||
:workspace-local nil
|
||||
:workspace-pdata nil
|
||||
:images-collections nil
|
||||
:images nil
|
||||
:icons-collections nil
|
||||
:icons nil
|
||||
:colors-collections colors/collections
|
||||
:projects nil
|
||||
:pages nil
|
||||
:pages-data nil})
|
||||
{:session-id (uuid/next)
|
||||
:profile (:profile storage)})
|
||||
;; :colors-collections colors/collections})
|
||||
|
||||
(defn init
|
||||
"Initialize the state materialization."
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
(and (map? error)
|
||||
(= :authentication type)
|
||||
(= :unauthorized code))
|
||||
(ts/schedule 0 #(st/emit! (rt/nav :login)))
|
||||
(ts/schedule 0 #(st/emit! logout))
|
||||
|
||||
;; Network error
|
||||
(and (map? error)
|
||||
|
|
Loading…
Add table
Reference in a new issue