Skip to content

Commit

Permalink
Fix space orphan filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr authored and bmarty committed Jun 13, 2022
1 parent 4ea2b19 commit 65bb1a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/6272.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: All rooms are shown in Home regardless of the switch state.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down Expand Up @@ -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 -> {
Expand Down

0 comments on commit 65bb1a7

Please sign in to comment.