fix accounts shown as disabled when asset is long-tapped if default account is empty

Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
Brian Sztamfater 2024-12-19 17:03:23 -03:00
parent 80bab0f976
commit 220798511b
No known key found for this signature in database
GPG Key ID: 59EB921E0706B48F
1 changed files with 9 additions and 6 deletions

View File

@ -547,13 +547,16 @@
(rf/reg-sub
:wallet/token-by-symbol
:<- [:wallet/current-viewing-account-or-default]
:<- [:wallet/accounts]
:<- [:wallet/network-details]
(fn [[{:keys [tokens]} networks] [_ token-symbol chain-ids]]
(->> (utils/tokens-with-balance tokens networks chain-ids)
(filter #(= (string/lower-case (:symbol %))
(string/lower-case token-symbol)))
first)))
(fn [[accounts networks] [_ token-symbol chain-ids]]
(some
(fn [{:keys [tokens]}]
(->> (utils/tokens-with-balance tokens networks chain-ids)
(filter #(= (string/lower-case (:symbol %))
(string/lower-case token-symbol)))
first))
accounts)))
(rf/reg-sub
:wallet/accounts-without-current-viewing-account