Fix issue when scrolling on collection details page (#2048)
## Description If a collection is using separated types and there were 2+ empty rows between types, then the forward composition wouldn't trigger and the next row would not appear. In practice this means if you have a Collection that contained Movies and Videos, you might not be able to scroll down from Movies to Videos. The fix is to filter out the empty rows before composing. ### Related issues Fixes #2046 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
b99f21efa8
commit
e23c446bb7
1 changed files with 9 additions and 6 deletions
|
|
@ -244,12 +244,15 @@ class CollectionViewModel
|
|||
}
|
||||
jobs.forEach { job ->
|
||||
val (type, row) = job.await()
|
||||
_state.update {
|
||||
val separateItems =
|
||||
it.separateItems.toMutableMap().apply {
|
||||
put(type, row)
|
||||
}
|
||||
it.copy(separateItems = separateItems)
|
||||
// Only include Success if non-empty
|
||||
if (row !is HomeRowLoadingState.Success || row.items.isNotEmpty()) {
|
||||
_state.update {
|
||||
val separateItems =
|
||||
it.separateItems.toMutableMap().apply {
|
||||
put(type, row)
|
||||
}
|
||||
it.copy(separateItems = separateItems)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue