mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
simplify call chain
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
443110557c
commit
84c1874284
@ -45,14 +45,13 @@ class UserManager internal constructor(private val userRepository: UsersReposito
|
|||||||
val results = userRepository.getUsersNotScheduledForDeletion()
|
val results = userRepository.getUsersNotScheduledForDeletion()
|
||||||
|
|
||||||
return results.map { users ->
|
return results.map { users ->
|
||||||
var result: User? = null
|
users
|
||||||
if (users.isNotEmpty()) {
|
.firstOrNull()
|
||||||
val user = users[0]
|
?.apply {
|
||||||
user.current = true
|
current = true
|
||||||
userRepository.updateUser(user)
|
}?.also { user ->
|
||||||
result = user
|
userRepository.updateUser(user)
|
||||||
}
|
}
|
||||||
result
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user