mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-29 11:11:44 +01:00
Added comparison between search term and display name to comparator to prioritise results with search term in name
This commit is contained in:
parent
abb2f0557d
commit
99641e1a12
@ -74,8 +74,13 @@ class SearchBarViewModel(
|
||||
_searchResultsUsers.emit(
|
||||
LocalCache
|
||||
.findUsersStartingWith(searchValue)
|
||||
.sortedWith(compareBy({ account.isFollowing(it) }, { it.toBestDisplayName() }))
|
||||
.reversed(),
|
||||
.sortedWith(
|
||||
compareBy(
|
||||
{ it.toBestDisplayName().startsWith(searchValue, true) },
|
||||
{ account.isFollowing(it) },
|
||||
{ it.toBestDisplayName() },
|
||||
),
|
||||
).reversed(),
|
||||
)
|
||||
_searchResultsNotes.emit(
|
||||
LocalCache
|
||||
|
Loading…
x
Reference in New Issue
Block a user