Merge pull request #310 from status-im/bug/#289

Allow the user to start using chat after account's creation
This commit is contained in:
Roman Volosovskyi 2016-10-04 11:30:36 +03:00 committed by GitHub
commit 4099cb5733
3 changed files with 11 additions and 5 deletions

View File

@ -36,6 +36,7 @@
account {:public-key public-key
:address address
:name address
:signed-up? true
:updates-public-key public
:updates-private-key private
:photo-path (identicon public-key)}]

View File

@ -5,7 +5,8 @@
[status-im.utils.types :refer [json->clj]]
[status-im.db :refer [default-view]]
[status-im.persistence.realm.core :as realm]
[status-im.components.status :as status]))
[status-im.components.status :as status]
[status-im.constants :refer [console-chat-id]]))
(defn set-login-from-qr
@ -19,7 +20,10 @@
(dispatch [:set :login {}])
(dispatch [:set-current-account address])
(dispatch [:initialize-account address])
(when new-account?
(if new-account?
(do
(dispatch [:navigate-to-clean :chat-list])
(dispatch [:navigate-to :chat console-chat-id]))
(do
(dispatch [:navigate-to-clean :accounts])
(dispatch [:navigate-to default-view]))))
@ -34,7 +38,7 @@
(defn on-account-changed
[error address new-account?]
(if (nil? error)
(initialize-account address true)
(initialize-account address new-account?)
(log/debug "Error changing acount realm: " error)))
(defn logged-in

View File

@ -10,7 +10,8 @@
[status-im.utils.handlers :as u]
[status-im.utils.utils :refer [require]]
[status-im.navigation.handlers :as nav]
[status-im.utils.random :as random]))
[status-im.utils.random :as random]
[taoensso.timbre :as log]))
(defmethod nav/preload-data! :group-contacts
@ -94,7 +95,7 @@
(.getAll react-native-contacts
(fn [error contacts]
(if error
(dispatch [:error-on-fetching-loading error])
(log/debug :error-on-fetching-loading error)
(let [contacts' (normalize-phone-contacts contacts)]
(dispatch [:get-contacts-identities contacts']))))))