Add manage mode to space view for removing child rooms, wip.
This commit is contained in:
parent
9b2cd12c26
commit
b7ff884838
11 changed files with 263 additions and 21 deletions
|
|
@ -18,4 +18,12 @@ interface SpaceService {
|
|||
fun spaceRoomList(id: RoomId): SpaceRoomList
|
||||
|
||||
fun getLeaveSpaceHandle(spaceId: RoomId): LeaveSpaceHandle
|
||||
|
||||
/**
|
||||
* Remove a child room from a space.
|
||||
* @param spaceId The space ID from which to remove the child.
|
||||
* @param childId The room ID of the child to remove.
|
||||
* @return A result indicating success or failure.
|
||||
*/
|
||||
suspend fun removeChildFromSpace(spaceId: RoomId, childId: RoomId): Result<Unit>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,12 @@ class RustSpaceService(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun removeChildFromSpace(spaceId: RoomId, childId: RoomId): Result<Unit> = withContext(sessionDispatcher) {
|
||||
runCatchingExceptions {
|
||||
innerSpaceService.removeChildFromSpace(spaceId.value, childId.value)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
innerSpaceService
|
||||
.spaceListUpdate()
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class FakeSpaceService(
|
|||
private val joinedSpacesResult: () -> Result<List<SpaceRoom>> = { lambdaError() },
|
||||
private val spaceRoomListResult: (RoomId) -> SpaceRoomList = { lambdaError() },
|
||||
private val leaveSpaceHandleResult: (RoomId) -> LeaveSpaceHandle = { lambdaError() },
|
||||
private val removeChildFromSpaceResult: (RoomId, RoomId) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
) : SpaceService {
|
||||
private val _spaceRoomsFlow = MutableSharedFlow<List<SpaceRoom>>()
|
||||
override val spaceRoomsFlow: SharedFlow<List<SpaceRoom>>
|
||||
|
|
@ -43,4 +44,8 @@ class FakeSpaceService(
|
|||
override fun getLeaveSpaceHandle(spaceId: RoomId): LeaveSpaceHandle {
|
||||
return leaveSpaceHandleResult(spaceId)
|
||||
}
|
||||
|
||||
override suspend fun removeChildFromSpace(spaceId: RoomId, childId: RoomId): Result<Unit> = simulateLongTask {
|
||||
removeChildFromSpaceResult(spaceId, childId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@
|
|||
<string name="action_load_more">"Load more"</string>
|
||||
<string name="action_manage_account">"Manage account"</string>
|
||||
<string name="action_manage_devices">"Manage devices"</string>
|
||||
<string name="action_manage_rooms">"Manage rooms"</string>
|
||||
<string name="action_message">"Message"</string>
|
||||
<string name="action_minimize">"Minimise"</string>
|
||||
<string name="action_next">"Next"</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue