Code readability

This commit is contained in:
Benoit Marty 2020-02-24 17:40:28 +01:00
parent 9c566b19f7
commit 1023982858
1 changed files with 4 additions and 4 deletions

View File

@ -101,17 +101,17 @@ class RoomListViewModel @Inject constructor(initialState: RoomListViewState,
.observeOn(Schedulers.computation()) .observeOn(Schedulers.computation())
.map { buildRoomSummaries(it) } .map { buildRoomSummaries(it) }
.execute { async -> .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 remainingJoining = joiningRoomsIds.intersect(invitedRooms)
val remainingJoinErrors = joiningErrorRoomsIds.intersect(invitedRooms)
val remainingRejecting = rejectingRoomsIds.intersect(invitedRooms) val remainingRejecting = rejectingRoomsIds.intersect(invitedRooms)
val remainingRejectErrors = rejectingErrorRoomsIds.intersect(invitedRooms) val remainingRejectErrors = rejectingErrorRoomsIds.intersect(invitedRooms)
val remainingJoinErrors = joiningErrorRoomsIds.intersect(invitedRooms)
copy( copy(
asyncFilteredRooms = async, asyncFilteredRooms = async,
joiningRoomsIds = remainingJoining, joiningRoomsIds = remainingJoining,
joiningErrorRoomsIds = remainingJoinErrors,
rejectingRoomsIds = remainingRejecting, rejectingRoomsIds = remainingRejecting,
rejectingErrorRoomsIds = remainingRejectErrors, rejectingErrorRoomsIds = remainingRejectErrors
joiningErrorRoomsIds = remainingJoinErrors
) )
} }
} }