Skip to content

Commit

Permalink
fix: wallet home loading state (#20297)
Browse files Browse the repository at this point in the history
* fix: wallet home loading state (#20297)
  • Loading branch information
OmarBasem authored Jun 5, 2024
1 parent 9445363 commit 9300377
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/db.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
:selected-networks (set constants/default-network-names)})

(def defaults
{:ui {:network-filter network-filter-defaults}})
{:ui {:network-filter network-filter-defaults
:tokens-loading? true}})
9 changes: 6 additions & 3 deletions src/status_im/contexts/wallet/events_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
matcher-combinators.test
[status-im.constants :as constants]
[status-im.contexts.wallet.collectible.events :as collectible-events]
[status-im.contexts.wallet.db :as db]
[status-im.contexts.wallet.events :as events]))

(def address "0x2f88d65f3cb52605a54a833ae118fb1363acccd2")
Expand Down Expand Up @@ -80,7 +79,9 @@
(deftest reset-selected-networks-test
(testing "reset-selected-networks"
(let [db {:wallet {}}
expected-db {:wallet db/defaults}
expected-db {:wallet {:ui {:network-filter {:selector-state :default
:selected-networks
(set constants/default-network-names)}}}}
effects (events/reset-selected-networks {:db db})
result-db (:db effects)]
(is (match? result-db expected-db)))))
Expand All @@ -101,7 +102,9 @@
(is (match? result-db expected-db))))

(testing "update-selected-networks > if all networks is already selected, update to incoming network"
(let [db {:wallet db/defaults}
(let [db {:wallet {:ui {:network-filter {:selector-state :default
:selected-networks
(set constants/default-network-names)}}}}
network-name constants/arbitrum-network-name
expected-db {:wallet {:ui {:network-filter {:selected-networks #{network-name}
:selector-state :changed}}}}
Expand Down

0 comments on commit 9300377

Please sign in to comment.