fix: Empty network preferences drawer for Default Asset in wallet overview
Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
parent
9648e36488
commit
6bfceb0862
|
@ -77,7 +77,8 @@
|
||||||
(defn token-value-drawer
|
(defn token-value-drawer
|
||||||
[token watch-only? entry-point]
|
[token watch-only? entry-point]
|
||||||
(let [token-symbol (:token token)
|
(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])
|
selected-account (rf/sub [:wallet/current-viewing-account-address])
|
||||||
token-owners (rf/sub [:wallet/operable-addresses-with-token-symbol token-symbol])
|
token-owners (rf/sub [:wallet/operable-addresses-with-token-symbol token-symbol])
|
||||||
testnet-mode? (rf/sub [:profile/test-networks-enabled?])
|
testnet-mode? (rf/sub [:profile/test-networks-enabled?])
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
(:chain-id (first networks-with-balance)))
|
(:chain-id (first networks-with-balance)))
|
||||||
network-details))
|
network-details))
|
||||||
network)]
|
network)]
|
||||||
|
(println multi-account-balance? "43247329479847392")
|
||||||
(when (or token-data token-symbol)
|
(when (or token-data token-symbol)
|
||||||
{:db (cond-> db
|
{:db (cond-> db
|
||||||
network (update-in [:wallet :ui :send]
|
network (update-in [:wallet :ui :send]
|
||||||
|
|
|
@ -35,7 +35,8 @@
|
||||||
(defn view
|
(defn view
|
||||||
[]
|
[]
|
||||||
(let [token-symbol (rf/sub [:wallet/send-token-symbol])
|
(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])
|
accounts (rf/sub [:wallet/accounts-with-balances token])
|
||||||
network-details (rf/sub [:wallet/network-details])]
|
network-details (rf/sub [:wallet/network-details])]
|
||||||
[floating-button-page/view
|
[floating-button-page/view
|
||||||
|
|
|
@ -556,7 +556,7 @@
|
||||||
first)))
|
first)))
|
||||||
|
|
||||||
(rf/reg-sub
|
(rf/reg-sub
|
||||||
:wallet/token-by-symbol-from-first-available-account
|
:wallet/token-by-symbol-from-first-available-account-with-balance
|
||||||
:<- [:wallet/accounts]
|
:<- [:wallet/accounts]
|
||||||
:<- [:wallet/current-viewing-account-or-default]
|
:<- [:wallet/current-viewing-account-or-default]
|
||||||
:<- [:wallet/network-details]
|
:<- [:wallet/network-details]
|
||||||
|
@ -564,14 +564,16 @@
|
||||||
(when token-symbol
|
(when token-symbol
|
||||||
(or
|
(or
|
||||||
(->> (utils/tokens-with-balance tokens networks chain-ids)
|
(->> (utils/tokens-with-balance tokens networks chain-ids)
|
||||||
(filter #(= (string/lower-case (:symbol %))
|
(filter #(and (= (string/lower-case (:symbol %))
|
||||||
(string/lower-case token-symbol)))
|
(string/lower-case token-symbol))
|
||||||
|
(money/greater-than (:total-balance %) 0)))
|
||||||
first)
|
first)
|
||||||
(some
|
(some
|
||||||
(fn [{:keys [tokens]}]
|
(fn [{:keys [tokens]}]
|
||||||
(->> (utils/tokens-with-balance tokens networks chain-ids)
|
(->> (utils/tokens-with-balance tokens networks chain-ids)
|
||||||
(filter #(= (string/lower-case (:symbol %))
|
(filter #(and (= (string/lower-case (:symbol %))
|
||||||
(string/lower-case token-symbol)))
|
(string/lower-case token-symbol))
|
||||||
|
(money/greater-than (:total-balance %) 0)))
|
||||||
first))
|
first))
|
||||||
accounts)))))
|
accounts)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue