mirror of https://github.com/logseq/logseq
chore: rename :user/login to :user/fetch-info-and-graphs
parent
a46b7226ad
commit
e1c5a40c30
|
@ -76,7 +76,7 @@
|
||||||
(async/go (async/<! (p->c (persist-var/load-vars)))
|
(async/go (async/<! (p->c (persist-var/load-vars)))
|
||||||
(async/<! (sync/<sync-stop))))
|
(async/<! (sync/<sync-stop))))
|
||||||
|
|
||||||
(defmethod handle :user/login [[_]]
|
(defmethod handle :user/fetch-info-and-graphs [[_]]
|
||||||
(state/set-state! [:ui/loading? :login] false)
|
(state/set-state! [:ui/loading? :login] false)
|
||||||
(async/go
|
(async/go
|
||||||
(let [result (async/<! (sync/<user-info sync/remoteapi))]
|
(let [result (async/<! (sync/<user-info sync/remoteapi))]
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
(go
|
(go
|
||||||
(<! (<refresh-id-token&access-token))
|
(<! (<refresh-id-token&access-token))
|
||||||
;; refresh remote graph list by pub login event
|
;; refresh remote graph list by pub login event
|
||||||
(when (user-uuid) (state/pub-event! [:user/login]))))))
|
(when (user-uuid) (state/pub-event! [:user/fetch-info-and-graphs]))))))
|
||||||
|
|
||||||
(defn login-callback [code]
|
(defn login-callback [code]
|
||||||
(state/set-state! [:ui/loading? :login] true)
|
(state/set-state! [:ui/loading? :login] true)
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
(-> resp
|
(-> resp
|
||||||
:body
|
:body
|
||||||
(as-> $ (set-tokens! (:id_token $) (:access_token $) (:refresh_token $)))
|
(as-> $ (set-tokens! (:id_token $) (:access_token $) (:refresh_token $)))
|
||||||
(#(state/pub-event! [:user/login])))
|
(#(state/pub-event! [:user/fetch-info-and-graphs])))
|
||||||
(debug/pprint "login-callback" resp)))))
|
(debug/pprint "login-callback" resp)))))
|
||||||
|
|
||||||
(defn logout []
|
(defn logout []
|
||||||
|
|
Loading…
Reference in New Issue