From 84a3fffe9f1c94fb09e4589191cb34f6cdf1e123 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 10 Dec 2024 17:44:54 +0100 Subject: [PATCH] Assets not sorted by fiat balance on 'Assets to pay' and 'Assets to receive' screens (#21636) --- src/status_im/contexts/wallet/common/utils.cljs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/status_im/contexts/wallet/common/utils.cljs b/src/status_im/contexts/wallet/common/utils.cljs index 669e65a50f..4f203e2209 100644 --- a/src/status_im/contexts/wallet/common/utils.cljs +++ b/src/status_im/contexts/wallet/common/utils.cljs @@ -404,15 +404,13 @@ :market-values-per-token market-values-per-token})) calculated-tokens (map calculate-token tokens)] (sort-by (fn [token] - (let [fiat-value (get-in token [:values :fiat-unformatted-value]) - priority (get constants/token-sort-priority (:token token) ##Inf)] - [(- fiat-value) priority])) + (let [fiat-value (get-in token [:values :fiat-unformatted-value])] + [(- fiat-value)])) calculated-tokens))) (defn sort-tokens [tokens] - (let [priority #(get constants/token-sort-priority (:symbol %) ##Inf)] - (sort-by (juxt (comp - :balance) priority) tokens))) + (sort-by (fn [token] (- (:balance token))) tokens)) (defn- transaction-data [{:keys [from-address to-address token-address route data eth-transfer?]}] @@ -543,8 +541,7 @@ (defn sort-tokens-by-name [tokens] - (let [priority #(get constants/token-sort-priority (:symbol %) ##Inf)] - (sort-by (juxt :symbol priority) tokens))) + (sort-by :symbol tokens)) (defn tokens-with-balance [tokens networks chain-ids]