[#9724] Status is not usable after relogin if add watch-only account that matches address of one of the created accounts

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2019-12-27 12:38:42 +01:00
parent acaea38551
commit c66e848255
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 10 additions and 2 deletions

View File

@ -526,6 +526,14 @@
(fn [accounts]
(filter #(not= (:type %) :watch) accounts)))
(re-frame/reg-sub
:add-account-disabled?
:<- [:multiaccount/accounts]
:<- [:add-account]
(fn [[accounts {:keys [address]}]]
(or (not (ethereum/address? address))
(some #(when (= (:address %) address) %) accounts))))
;;CHAT ==============================================================================================================
(re-frame/reg-sub

View File

@ -62,7 +62,7 @@
:background-color colors/gray-lighter})
(defview add-watch-account []
(letsubs [{:keys [address]} [:add-account]]
(letsubs [add-account-disabled? [:add-account-disabled?]]
[react/keyboard-avoiding-view {:flex 1}
[topbar/topbar]
[react/view {:flex 1
@ -84,7 +84,7 @@
:right {:type :next
:label "Next"
:on-press #(re-frame/dispatch [:wallet.accounts/add-watch-account])
:disabled? (not (ethereum/address? address))}}]]))
:disabled? add-account-disabled?}}]]))
(defview pin []
(letsubs [pin [:hardwallet/pin]