fix(saved-addresses): grouping and sorting of saved addresses (#20689)

This commit fixes the grouping and sorting of saved addresses.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
Mohamed Javid 2024-07-12 19:25:39 +05:30 committed by GitHub
parent 0e6d59b312
commit 12b8dcf1e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -38,11 +38,11 @@
(fn [saved-addresses]
(->> saved-addresses
vals
(sort-by :name)
(group-by #(string/upper-case (first (:name %))))
(group-by (comp string/upper-case first :name))
(map (fn [[k v]]
{:title k
:data v})))))
:data (sort-by (comp string/lower-case :name) v)}))
(sort-by :title))))
(rf/reg-sub
:wallet/saved-addresses-addresses
@ -62,7 +62,7 @@
(fn [saved-addresses [_ query]]
(->> saved-addresses
vals
(sort-by :name)
(sort-by (comp string/lower-case :name))
(filter
(fn [{:keys [name address ens chain-short-names]}]
(let [lowercase-query (string/lower-case (string/trim query))]