fix: Empty network preferences drawer for Default Asset in wallet overview

Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
Brian Sztamfater 2024-12-20 14:59:34 -03:00
parent 9648e36488
commit 6bfceb0862
No known key found for this signature in database
GPG Key ID: 59EB921E0706B48F
4 changed files with 12 additions and 7 deletions

View File

@ -77,7 +77,8 @@
(defn token-value-drawer
[token watch-only? entry-point]
(let [token-symbol (:token token)
token-data (rf/sub [:wallet/token-by-symbol-from-first-available-account token-symbol])
token-data (rf/sub [:wallet/token-by-symbol-from-first-available-account-with-balance
token-symbol])
selected-account (rf/sub [:wallet/current-viewing-account-address])
token-owners (rf/sub [:wallet/operable-addresses-with-token-symbol token-symbol])
testnet-mode? (rf/sub [:profile/test-networks-enabled?])

View File

@ -180,6 +180,7 @@
(:chain-id (first networks-with-balance)))
network-details))
network)]
(println multi-account-balance? "43247329479847392")
(when (or token-data token-symbol)
{:db (cond-> db
network (update-in [:wallet :ui :send]

View File

@ -35,7 +35,8 @@
(defn view
[]
(let [token-symbol (rf/sub [:wallet/send-token-symbol])
token (rf/sub [:wallet/token-by-symbol-from-first-available-account token-symbol])
token (rf/sub [:wallet/token-by-symbol-from-first-available-account-with-balance
token-symbol])
accounts (rf/sub [:wallet/accounts-with-balances token])
network-details (rf/sub [:wallet/network-details])]
[floating-button-page/view

View File

@ -556,7 +556,7 @@
first)))
(rf/reg-sub
:wallet/token-by-symbol-from-first-available-account
:wallet/token-by-symbol-from-first-available-account-with-balance
:<- [:wallet/accounts]
:<- [:wallet/current-viewing-account-or-default]
:<- [:wallet/network-details]
@ -564,14 +564,16 @@
(when token-symbol
(or
(->> (utils/tokens-with-balance tokens networks chain-ids)
(filter #(= (string/lower-case (:symbol %))
(string/lower-case token-symbol)))
(filter #(and (= (string/lower-case (:symbol %))
(string/lower-case token-symbol))
(money/greater-than (:total-balance %) 0)))
first)
(some
(fn [{:keys [tokens]}]
(->> (utils/tokens-with-balance tokens networks chain-ids)
(filter #(= (string/lower-case (:symbol %))
(string/lower-case token-symbol)))
(filter #(and (= (string/lower-case (:symbol %))
(string/lower-case token-symbol))
(money/greater-than (:total-balance %) 0)))
first))
accounts)))))