Andrey Shovkoplyas 2017-01-20 11:27:29 +03:00 committed by Roman Volosovskyi
parent dc38ba94c6
commit 556b9beec7
3 changed files with 6 additions and 7 deletions

View File

@ -155,11 +155,13 @@
(let [accounts (->> (accounts-store/get-all) (let [accounts (->> (accounts-store/get-all)
(map (fn [{:keys [address] :as account}] (map (fn [{:keys [address] :as account}]
[address account])) [address account]))
(into {}))] (into {}))
view (if (empty? accounts)
:chat
:accounts)]
(assoc db :accounts accounts (assoc db :accounts accounts
:view-id (if (empty? accounts) :view-id view
:chat :navigation-stack (list view))))
:accounts))))
(register-handler :load-accounts load-accounts!) (register-handler :load-accounts load-accounts!)

View File

@ -39,8 +39,6 @@
(defn create-account [_] (defn create-account [_]
(dispatch-sync [:reset-app]) (dispatch-sync [:reset-app])
; add accounts screen to history ( maybe there is a better way ? )
(dispatch [:navigate-to-clean :accounts])
(dispatch [:navigate-to :chat console-chat-id])) (dispatch [:navigate-to :chat console-chat-id]))
(defview accounts [] (defview accounts []

View File

@ -11,7 +11,6 @@
[status-im.accounts.styles :as st])) [status-im.accounts.styles :as st]))
(defn on-press [address] (defn on-press [address]
(dispatch [:navigate-to-clean :accounts])
(dispatch [:navigate-to :login address]) (dispatch [:navigate-to :login address])
(dispatch [:set-in [:login :address] address])) (dispatch [:set-in [:login :address] address]))