From 9300377c6cf02072f574c886a5f829b78180b6ca Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 5 Jun 2024 13:21:15 +0400 Subject: [PATCH] fix: wallet home loading state (#20297) * fix: wallet home loading state (#20297) --- src/status_im/contexts/wallet/db.cljs | 3 ++- src/status_im/contexts/wallet/events_test.cljs | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/status_im/contexts/wallet/db.cljs b/src/status_im/contexts/wallet/db.cljs index 6d98804f13..17b8aa9dd0 100644 --- a/src/status_im/contexts/wallet/db.cljs +++ b/src/status_im/contexts/wallet/db.cljs @@ -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}}) diff --git a/src/status_im/contexts/wallet/events_test.cljs b/src/status_im/contexts/wallet/events_test.cljs index 1ba5aca22e..80d2c60ccf 100644 --- a/src/status_im/contexts/wallet/events_test.cljs +++ b/src/status_im/contexts/wallet/events_test.cljs @@ -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") @@ -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))))) @@ -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}}}}