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) .flowOn(Dispatchers.Default)
.launchIn(viewModelScope) .launchIn(viewModelScope)
val itemCountFlow = livePagedList.asFlow()
.flatMapLatest { session.getRoomCountFlow(roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId())) }
sections.add( sections.add(
RoomsSection( RoomsSection(
sectionName = name, sectionName = name,
livePages = livePagedList, livePages = livePagedList,
notifyOfLocalEcho = notifyOfLocalEcho, notifyOfLocalEcho = notifyOfLocalEcho,
// TODO not working when switching spaces, how does the query is updated in this case? itemCount = itemCountFlow
itemCount = session.getRoomCountFlow(roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId()))
) )
) )
} }