fixing rooms from other spaces being included in home due to wrong filter param

- we were passing null which meant no filter was being applied
This commit is contained in:
Adam Brown 2022-07-28 10:10:01 +01:00
parent 050c23b578
commit 1ba8d29333
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -124,7 +124,7 @@ class HomeRoomListViewModel @AssistedInject constructor(
private fun getSpaceFilter(selectedSpaceId: String?, strategy: RoomListViewModel.SpaceFilterStrategy): SpaceFilter? {
return when (strategy) {
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL -> {
selectedSpaceId?.toActiveSpaceOrOrphanRooms()
selectedSpaceId.toActiveSpaceOrOrphanRooms()
}
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL -> {
selectedSpaceId?.let { SpaceFilter.ActiveSpace(it) }