mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Select all rooms by default
This commit is contained in:
committed by
Benoit Marty
parent
de6f52c72a
commit
f503bc401e
+5
-1
@@ -65,6 +65,8 @@ class LeaveSpacePresenter(
|
|||||||
roomId = RoomId("!roomId2:example.com"),
|
roomId = RoomId("!roomId2:example.com"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
// By default select all rooms
|
||||||
|
selectedRoomIds.value = rooms.map { it.roomId }.toSet()
|
||||||
value = rooms
|
value = rooms
|
||||||
}
|
}
|
||||||
val selectableSpaceRooms by produceState<AsyncData<ImmutableList<SelectableSpaceRoom>>>(
|
val selectableSpaceRooms by produceState<AsyncData<ImmutableList<SelectableSpaceRoom>>>(
|
||||||
@@ -86,7 +88,9 @@ class LeaveSpacePresenter(
|
|||||||
|
|
||||||
fun handleEvents(event: LeaveSpaceEvents) {
|
fun handleEvents(event: LeaveSpaceEvents) {
|
||||||
when (event) {
|
when (event) {
|
||||||
LeaveSpaceEvents.DeselectAllRooms -> selectedRoomIds.value = emptySet()
|
LeaveSpaceEvents.DeselectAllRooms -> {
|
||||||
|
selectedRoomIds.value = emptySet()
|
||||||
|
}
|
||||||
LeaveSpaceEvents.SelectAllRooms -> {
|
LeaveSpaceEvents.SelectAllRooms -> {
|
||||||
selectedRoomIds.value = selectableSpaceRooms.dataOrNull()
|
selectedRoomIds.value = selectableSpaceRooms.dataOrNull()
|
||||||
.orEmpty()
|
.orEmpty()
|
||||||
|
|||||||
Reference in New Issue
Block a user