From 2be9871d0528720b2cc0f92d95e4ef135558cc22 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 27 Nov 2020 21:09:44 -0500 Subject: [PATCH] Distinguish between no results and loading when sorting global search results --- .../ui/browse/source/globalsearch/GlobalSearchPresenter.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt index a8f756b85b..9912413c59 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt @@ -185,7 +185,8 @@ open class GlobalSearchPresenter( .sortedWith( compareBy( // 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 { it.source.id.toString() !in pinnedSourceIds }, { "${it.source.name.toLowerCase()} (${it.source.lang})" }