Fix computing the time it takes to render the first rooms

This commit is contained in:
Stefan Ceriu 2023-08-29 09:20:14 +03:00 committed by Stefan Ceriu
parent 734d8bba04
commit b5c8676d95
3 changed files with 6 additions and 4 deletions

View File

@ -138,6 +138,8 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
return
}
ServiceLocator.shared.analytics.signpost.beginFirstRooms()
// Combine together the state and the room list to correctly compute the view state if
// data is present in the room list "cold cache"
Publishers.CombineLatest(roomSummaryProvider.statePublisher,
@ -162,6 +164,10 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
return
}
if roomListMode == .rooms, self.state.roomListMode == .skeletons {
ServiceLocator.shared.analytics.signpost.endFirstRooms()
}
self.state.roomListMode = roomListMode
MXLog.info("Received room summary provider update, setting view room list mode to \"\(self.state.roomListMode)\"")

View File

@ -399,8 +399,6 @@ class ClientProxy: ClientProxyProtocol {
appIdentifier: "MainApp")
.finish()
let roomListService = syncService.roomListService()
ServiceLocator.shared.analytics.signpost.beginFirstRooms()
let eventStringBuilder = RoomEventStringBuilder(stateEventStringBuilder: RoomStateEventStringBuilder(userID: userID))
roomSummaryProvider = RoomSummaryProvider(roomListService: roomListService,

View File

@ -166,8 +166,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
MXLog.verbose("\(name): Finished applying \(diffs.count) diffs, new room list \(rooms.compactMap { $0.id ?? "Empty" })")
ServiceLocator.shared.analytics.signpost.endFirstRooms()
MXLog.info("Finished processing room list diffs")
}