fix #1804 - duplicated status in discover tab

This commit is contained in:
Eric Dvorsak 2017-09-10 21:46:42 +02:00 committed by Roman Volosovskyi
parent 7875e11ea0
commit 7a06bb8278
1 changed files with 10 additions and 9 deletions

View File

@ -128,7 +128,7 @@
(register-handler-fx
:check-status-change
(fn [{:accounts/keys [accounts current-account-id]} [_ status]]
(fn [{{:accounts/keys [accounts current-account-id]} :db} [_ status]]
(let [{old-status :status} (get accounts current-account-id)
status-updated? (and (not= status nil)
(not= status old-status))]
@ -150,9 +150,9 @@
{:db (assoc-in db [:accounts/accounts current-account-id] new-account)
::save-account new-account
::broadcast-account-update (merge
(select-keys db [:current-public-key :web3])
(select-keys new-account [:name :photo-path :status
:updates-public-key :updates-private-key]))})))
(select-keys db [:current-public-key :web3])
(select-keys new-account [:name :photo-path :status
:updates-public-key :updates-private-key]))})))
(register-handler-fx
:account-update-keys
@ -166,9 +166,9 @@
{:db (assoc-in db [:accounts/accounts current-account-id] new-account)
::save-account new-account
::send-keys-update (merge
(select-keys db [:web3 :current-public-key :contacts])
(select-keys new-account [:updates-public-key
:updates-private-key]))})))
(select-keys db [:web3 :current-public-key :contacts])
(select-keys new-account [:updates-public-key
:updates-private-key]))})))
(register-handler-fx
:send-account-update-if-needed
@ -184,5 +184,6 @@
:set-current-account
(fn [{:accounts/keys [accounts] :as db} [_ address]]
(let [key (:public-key (accounts address))]
(assoc db :accounts/current-account-id address
:current-public-key key))))
(assoc db
:accounts/current-account-id address
:current-public-key key))))