Merge pull request #1131 from davotoula/prioritise-name-when-searching
Prioritise search results with user name starting with search term
This commit is contained in:
+7
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user