From d2fb6c7ee08857dc988b3914a74479d6e265cf87 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Thu, 23 May 2024 17:52:14 +0400 Subject: [PATCH] fix: balances in network preferences after removing account (#20139) fix: balances in network preferences after removing account (#20139) --- src/status_im/contexts/wallet/account/view.cljs | 1 + src/status_im/contexts/wallet/events.cljs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status_im/contexts/wallet/account/view.cljs b/src/status_im/contexts/wallet/account/view.cljs index b6ce0bf77d..9650be655e 100644 --- a/src/status_im/contexts/wallet/account/view.cljs +++ b/src/status_im/contexts/wallet/account/view.cljs @@ -28,6 +28,7 @@ (let [{:keys [name color formatted-balance watch-only?]} (rf/sub [:wallet/current-viewing-account]) customization-color (rf/sub [:profile/customization-color])] + (rn/use-unmount #(rf/dispatch [:wallet/close-account-page])) [rn/view {:style {:flex 1}} [account-switcher/view {:type :wallet-networks diff --git a/src/status_im/contexts/wallet/events.cljs b/src/status_im/contexts/wallet/events.cljs index 8e17276b68..18549665cc 100644 --- a/src/status_im/contexts/wallet/events.cljs +++ b/src/status_im/contexts/wallet/events.cljs @@ -102,7 +102,8 @@ (rf/reg-event-fx :wallet/remove-account-success (fn [_ [toast-message _]] - {:fx [[:dispatch [:wallet/get-accounts]] + {:fx [[:dispatch [:wallet/clean-current-viewing-account]] + [:dispatch [:wallet/get-accounts]] [:dispatch [:wallet/get-keypairs]] [:dispatch-later {:ms 100