correctly detect end of pagination in network timeline (#2296)
* correctly detect end of pagination in network timeline closes #2293 * improve NetworkTimelineRemoteMediatorTest * remove unused import
This commit is contained in:
parent
f29e46ad55
commit
a000228165
2 changed files with 105 additions and 1 deletions
|
@ -47,7 +47,11 @@ class NetworkTimelineRemoteMediator(
|
|||
}
|
||||
LoadType.APPEND -> {
|
||||
val maxId = viewModel.nextKey
|
||||
viewModel.fetchStatusesForKind(maxId, null, limit = state.config.pageSize)
|
||||
if (maxId != null) {
|
||||
viewModel.fetchStatusesForKind(maxId, null, limit = state.config.pageSize)
|
||||
} else {
|
||||
return MediatorResult.Success(endOfPaginationReached = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue