shorter code

This commit is contained in:
Benoit Marty 2019-10-24 18:52:34 +02:00
parent 0040f8e924
commit fbf73c7c8e

View file

@ -76,11 +76,8 @@ class TextComposerViewModel @AssistedInject constructor(@Assisted initialState:
Observable.combineLatest<List<String>, Option<AutocompleteUserQuery>, List<User>>(
room.rx().liveRoomMemberIds(),
usersQueryObservable.throttleLast(300, TimeUnit.MILLISECONDS),
BiFunction { roomMembers, query ->
val users = roomMembers
.mapNotNull {
session.getUser(it)
}
BiFunction { roomMemberIds, query ->
val users = roomMemberIds.mapNotNull { session.getUser(it) }
val filter = query.orNull()
if (filter.isNullOrBlank()) {