Merge pull request #5498 from element-hq/feature/bma/filterDirectInLeaveSpace
Filter out direct room in the leave space screen.
This commit is contained in:
commit
891485de50
2 changed files with 48 additions and 2 deletions
|
|
@ -66,7 +66,8 @@ class LeaveSpacePresenter(
|
|||
.orEmpty()
|
||||
.partition { it.spaceRoom.roomId == leaveSpaceHandle.id }
|
||||
// By default select all rooms that can be left
|
||||
selectedRoomIds = otherRooms
|
||||
val otherRoomsExcludingDm = otherRooms.filter { it.spaceRoom.isDirect != true }
|
||||
selectedRoomIds = otherRoomsExcludingDm
|
||||
.filter { it.isLastAdmin.not() }
|
||||
.map { it.spaceRoom.roomId }
|
||||
leaveSpaceRooms = rooms.fold(
|
||||
|
|
@ -74,7 +75,7 @@ class LeaveSpacePresenter(
|
|||
AsyncData.Success(
|
||||
LeaveSpaceRooms(
|
||||
current = currentRoom.firstOrNull(),
|
||||
others = otherRooms.toImmutableList(),
|
||||
others = otherRoomsExcludingDm.toImmutableList(),
|
||||
)
|
||||
)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue