mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fix room pickers not loading more than the first page of rooms
The forward, share, add-to-space and search pickers signal reaching the
bottom of the list with an empty `roomCount..<roomCount` range. The
prefetch sink added in 9dd9fd917 guards on `!range.isEmpty` to skip the
initial `0..<0`, which also dropped the pickers' bottom signal, so they
never loaded past the first 100 rooms.
Only skip `0..<0` instead, which leaves the home screen prefetch as it
was, and cover the bottom, prefetch and top cases in
RoomSummaryProviderTests.
This commit is contained in:
@@ -192,7 +192,8 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
visibleItemRangePublisher
|
||||
.sink { [weak self] range in
|
||||
guard let self,
|
||||
!range.isEmpty,
|
||||
// Pickers send an empty `count..<count` range when reaching the bottom, so only ignore `0..<0` (the initial value or the top).
|
||||
range.upperBound > 0,
|
||||
range.upperBound >= rooms.count - Int(roomListPageSize) / 2,
|
||||
rooms.count != roomCountOnLastPageAddRequest else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user