mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
Check last entry
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
59e721c405
commit
a971dbd5d2
1 changed files with 3 additions and 2 deletions
|
@ -43,7 +43,6 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun name(): String? = results.lastOrNull()?.name
|
||||
}
|
||||
|
||||
|
@ -197,11 +196,13 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
|||
searchResults.value = results
|
||||
.filter { it.value.results.isNotEmpty() }
|
||||
.map { (key, value) ->
|
||||
val isLastEntryHaveValue = results[key]?.results?.last()?.entries?.isEmpty() != true
|
||||
|
||||
UnifiedSearchSection(
|
||||
providerID = key,
|
||||
name = value.name()!!,
|
||||
entries = value.results.flatMap { it.entries },
|
||||
hasMoreResults = results.isNotEmpty() && results[key]?.nextCursor() != null
|
||||
hasMoreResults = isLastEntryHaveValue && results[key]?.nextCursor() != null
|
||||
)
|
||||
}
|
||||
.sortedWith { o1, o2 ->
|
||||
|
|
Loading…
Reference in a new issue