mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 22:26:11 +02: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/reify ::clear-user-data
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(merge state (dissoc initial-state :route :router)))
|
(select-keys state [:route :router :session-id]))
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state s]
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
(def logout
|
(def logout
|
||||||
(ptk/reify ::logout
|
(ptk/reify ::logout
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state stream]
|
||||||
(rx/of (rt/nav :login)
|
(rx/of (rt/nav :login)
|
||||||
clear-user-data))))
|
clear-user-data))))
|
||||||
|
|
||||||
|
|
|
@ -54,24 +54,9 @@
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(def initial-state
|
(def initial-state
|
||||||
{:route nil
|
{:session-id (uuid/next)
|
||||||
:router nil
|
:profile (:profile storage)})
|
||||||
:session-id (uuid/next)
|
;; :colors-collections colors/collections})
|
||||||
: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})
|
|
||||||
|
|
||||||
(defn init
|
(defn init
|
||||||
"Initialize the state materialization."
|
"Initialize the state materialization."
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
(and (map? error)
|
(and (map? error)
|
||||||
(= :authentication type)
|
(= :authentication type)
|
||||||
(= :unauthorized code))
|
(= :unauthorized code))
|
||||||
(ts/schedule 0 #(st/emit! (rt/nav :login)))
|
(ts/schedule 0 #(st/emit! logout))
|
||||||
|
|
||||||
;; Network error
|
;; Network error
|
||||||
(and (map? error)
|
(and (map? error)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue