From 220798511b6ddad041b042a4880169b9163e8e95 Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Thu, 19 Dec 2024 17:03:23 -0300 Subject: [PATCH] fix accounts shown as disabled when asset is long-tapped if default account is empty Signed-off-by: Brian Sztamfater --- src/status_im/subs/wallet/wallet.cljs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/status_im/subs/wallet/wallet.cljs b/src/status_im/subs/wallet/wallet.cljs index 5f4b1189a2..a15ecf169d 100644 --- a/src/status_im/subs/wallet/wallet.cljs +++ b/src/status_im/subs/wallet/wallet.cljs @@ -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