Display the room list even if the room count is not exact (#800)

* Add log to know why HomeScreenViewModel.roomListMode is .skeletons

To better understand issue #796

* Display the room list even if the room count is not exact

This is a workaround for #796
This commit is contained in:
manuroe 2023-04-13 20:46:44 +02:00 committed by GitHub
parent 1b5dfad607
commit 69e696afca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
.sink { [weak self] roomSummaryProviderState, totalCount, rooms in
guard let self else { return }
let isLoadingData = roomSummaryProviderState != .fullyLoaded && (totalCount == 0 || rooms.count != totalCount)
let isLoadingData = roomSummaryProviderState != .fullyLoaded && (totalCount == 0 || rooms.count < totalCount)
let hasNoRooms = roomSummaryProviderState == .fullyLoaded && totalCount == 0
var roomListMode = self.state.roomListMode
@ -92,6 +92,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
self.state.roomListMode = roomListMode
MXLog.info("Received visibleRoomsSummaryProvider update, setting view room list mode to \"\(self.state.roomListMode)\"")
if roomListMode == .skeletons {
MXLog.info("roomSummaryProviderState: \(roomSummaryProviderState). rooms.count: \(rooms.count) / totalCount: \(totalCount)")
}
// Delay user profile detail loading until after the initial room list loads
if roomListMode == .rooms {

View File

@ -89,7 +89,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
detectDuplicatesInRoomList(rooms)
MXLog.info("Finished applying \(diffs.count) diffs")
MXLog.info("Finished applying \(diffs.count) diffs, new count: \(rooms.count)")
}
private func buildRoomSummaryForIdentifier(_ identifier: String, invalidated: Bool) -> RoomSummary {

1
changelog.d/796.bugfix Normal file
View File

@ -0,0 +1 @@
Display the room list even if the room count is not exact.