Distinguish between no results and loading when sorting global search results

This commit is contained in:
arkon 2020-11-27 21:09:44 -05:00
parent 776f6a9a16
commit 2be9871d05

View file

@ -185,7 +185,8 @@ open class GlobalSearchPresenter(
.sortedWith( .sortedWith(
compareBy( compareBy(
// Bubble up sources that actually have results // Bubble up sources that actually have results
{ it.results.isNullOrEmpty() }, { it.results?.isEmpty() },
{ it.results == null },
// Same as initial sort, i.e. pinned first then alphabetically // Same as initial sort, i.e. pinned first then alphabetically
{ it.source.id.toString() !in pinnedSourceIds }, { it.source.id.toString() !in pinnedSourceIds },
{ "${it.source.name.toLowerCase()} (${it.source.lang})" } { "${it.source.name.toLowerCase()} (${it.source.lang})" }