Fix space orphan filtering

This commit is contained in:
Valere 2022-06-10 11:35:19 +02:00 committed by Benoit Marty
parent 4ea2b19351
commit 65bb1a7ddc
3 changed files with 5 additions and 4 deletions

1
changelog.d/6272.bugfix Normal file
View file

@ -0,0 +1 @@
Fix: All rooms are shown in Home regardless of the switch state.

View file

@ -289,7 +289,7 @@ class HomeDetailViewModel @AssistedInject constructor(
.launchIn(viewModelScope)
}
private fun RoomGroupingMethod.BySpace.toActiveSpaceOrOrphanRooms(): SpaceFilter? {
return spaceSummary?.roomId?.toActiveSpaceOrOrphanRooms()
private fun RoomGroupingMethod.BySpace.toActiveSpaceOrOrphanRooms(): SpaceFilter {
return spaceSummary?.roomId.toActiveSpaceOrOrphanRooms()
}
}

View file

@ -371,7 +371,7 @@ class RoomListSectionBuilderSpace(
activeSpaceUpdaters.add(object : RoomListViewModel.ActiveSpaceQueryUpdater {
override fun updateForSpaceId(roomId: String?) {
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
spaceFilter = roomId?.toActiveSpaceOrOrphanRooms()
spaceFilter = roomId.toActiveSpaceOrOrphanRooms()
)
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
}
@ -437,7 +437,7 @@ class RoomListSectionBuilderSpace(
return when (spaceFilter) {
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL -> {
copy(
spaceFilter = currentSpace?.toActiveSpaceOrOrphanRooms()
spaceFilter = currentSpace.toActiveSpaceOrOrphanRooms()
)
}
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL -> {