Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed May 22, 2024
1 parent 25b578a commit 7efa1a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/status_im/contexts/wallet/account/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
{:fx [[:dispatch [:toasts/upsert {:type :positive :text toast-message}]]]}))

(defn remove-account-success
[{:keys [db]} [toast-message _]]
{:db (assoc-in db [:wallet :current-viewing-account-address] nil)
:fx [[:dispatch [:wallet/get-accounts]]
[_ [toast-message _]]
{:fx [[:dispatch [:wallet/clean-current-viewing-account]]
[:dispatch [:wallet/get-accounts]]
[:dispatch [:wallet/get-keypairs]]
[:dispatch-later
{:ms 100
Expand All @@ -114,8 +114,6 @@
{:ms 100
:dispatch [:wallet/show-account-deleted-toast toast-message]}]]})

(rf/reg-event-fx :wallet/remove-account-success remove-account-success)

(rf/reg-event-fx
:wallet/remove-account
(fn [_ [{:keys [address toast-message]}]]
Expand Down
8 changes: 0 additions & 8 deletions src/status_im/contexts/wallet/events_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,3 @@
effects (events/update-selected-networks {:db db} props)
result-fx (:fx effects)]
(is (match? result-fx expected-fx)))))

(deftest remove-account-success
(testing "remove-account-success"
(let [db {:wallet {:current-viewing-account-address "0x123"}}
expected-db {:wallet {}}
effects (events/remove-account-success {:db db} nil)
result-db (:db effects)]
(is (match? result-db expected-db)))))

0 comments on commit 7efa1a0

Please sign in to comment.