mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +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()
|
||||
|
||||
return results.map { users ->
|
||||
var result: User? = null
|
||||
if (users.isNotEmpty()) {
|
||||
val user = users[0]
|
||||
user.current = true
|
||||
userRepository.updateUser(user)
|
||||
result = user
|
||||
}
|
||||
result
|
||||
users
|
||||
.firstOrNull()
|
||||
?.apply {
|
||||
current = true
|
||||
}?.also { user ->
|
||||
userRepository.updateUser(user)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user