From 8eed77a82af5362e3692c0d5966d2cde53f66b8e Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Sat, 21 Dec 2019 08:31:48 -0500 Subject: [PATCH] Remove balances for deleted watch account Signed-off-by: Churikova Tetiana --- src/status_im/wallet/accounts/core.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/status_im/wallet/accounts/core.cljs b/src/status_im/wallet/accounts/core.cljs index 1527705fc3..65e4e970d2 100644 --- a/src/status_im/wallet/accounts/core.cljs +++ b/src/status_im/wallet/accounts/core.cljs @@ -102,12 +102,15 @@ {:events [:wallet.accounts/delete-account]} [{:keys [db] :as cofx} account] (let [accounts (:multiaccount/accounts db) - new-accounts (vec (remove #(= account %) accounts))] + new-accounts (vec (remove #(= account %) accounts)) + deleted-address (get-in account [:address])] (fx/merge cofx {::json-rpc/call [{:method "accounts_deleteAccount" :params [(:address account)] :on-success #()}] - :db (assoc db :multiaccount/accounts new-accounts)} + :db (-> db + (assoc :multiaccount/accounts new-accounts) + (assoc-in [:wallet :accounts deleted-address] nil))} (navigation/navigate-to-cofx :wallet nil)))) (fx/defn save-generated-account