Code readability

This commit is contained in:
Benoit Marty 2020-02-24 17:40:28 +01:00
parent 9c566b19f7
commit 1023982858

View file

@ -101,17 +101,17 @@ class RoomListViewModel @Inject constructor(initialState: RoomListViewState,
.observeOn(Schedulers.computation())
.map { buildRoomSummaries(it) }
.execute { async ->
val invitedRooms = async()?.get(RoomCategory.INVITE)?.map { it.roomId } ?: emptyList()
val invitedRooms = async()?.get(RoomCategory.INVITE)?.map { it.roomId }.orEmpty()
val remainingJoining = joiningRoomsIds.intersect(invitedRooms)
val remainingJoinErrors = joiningErrorRoomsIds.intersect(invitedRooms)
val remainingRejecting = rejectingRoomsIds.intersect(invitedRooms)
val remainingRejectErrors = rejectingErrorRoomsIds.intersect(invitedRooms)
val remainingJoinErrors = joiningErrorRoomsIds.intersect(invitedRooms)
copy(
asyncFilteredRooms = async,
joiningRoomsIds = remainingJoining,
joiningErrorRoomsIds = remainingJoinErrors,
rejectingRoomsIds = remainingRejecting,
rejectingErrorRoomsIds = remainingRejectErrors,
joiningErrorRoomsIds = remainingJoinErrors
rejectingErrorRoomsIds = remainingRejectErrors
)
}
}