Fix switching space use case

This commit is contained in:
Maxime Naturel 2022-02-09 10:10:23 +01:00
parent b72c357dd1
commit c79aa267c3
1 changed files with 4 additions and 2 deletions

View File

@ -399,13 +399,15 @@ class RoomListSectionBuilderSpace(
.flowOn(Dispatchers.Default)
.launchIn(viewModelScope)
val itemCountFlow = livePagedList.asFlow()
.flatMapLatest { session.getRoomCountFlow(roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId())) }
sections.add(
RoomsSection(
sectionName = name,
livePages = livePagedList,
notifyOfLocalEcho = notifyOfLocalEcho,
// TODO not working when switching spaces, how does the query is updated in this case?
itemCount = session.getRoomCountFlow(roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId()))
itemCount = itemCountFlow
)
)
}