User identity load on first run

Former-commit-id: 6c6a4df339
This commit is contained in:
virvar 2016-03-19 11:53:09 +03:00
parent 6f2863eae0
commit 05b2966422
2 changed files with 3 additions and 1 deletions

View File

@ -77,7 +77,7 @@
(text {:style {:marginVertical 10 (text {:style {:marginVertical 10
:textAlign "center"}} :textAlign "center"}}
"Sign up")))) "Sign up"))))
(when loading (when (or loading (not user-identity))
(spinner {:visible true})))))) (spinner {:visible true}))))))
(def login (om/factory Login)) (def login (om/factory Login))

View File

@ -1,6 +1,7 @@
(ns messenger.services.protocol (ns messenger.services.protocol
(:require [messenger.models.protocol :refer [set-initialized (:require [messenger.models.protocol :refer [set-initialized
update-identity]] update-identity]]
[messenger.comm.intercom :refer [load-user-identity]]
[syng-im.utils.logging :as log])) [syng-im.utils.logging :as log]))
(defmulti protocol (fn [state id args] (defmulti protocol (fn [state id args]
@ -10,6 +11,7 @@
[state id {:keys [identity] :as args}] [state id {:keys [identity] :as args}]
(log/info "handling " id "args = " args) (log/info "handling " id "args = " args)
(update-identity identity) (update-identity identity)
(load-user-identity)
(set-initialized true)) (set-initialized true))
(defn protocol-handler [state [id args]] (defn protocol-handler [state [id args]]