Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets not sorted by fiat balance on 'Assets to pay' and 'Assets to receive' screens (#21636) #21790

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/status_im/contexts/wallet/common/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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?]}]
Expand Down Expand Up @@ -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]
Expand Down