rename updateUser to updateOrCreateUser

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-07-18 18:51:40 +02:00
parent 96910c02a1
commit 7ce5746969
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 3 additions and 3 deletions

View file

@ -327,7 +327,7 @@ class SettingsController : NewBaseController(R.layout.controller_settings) {
}
currentUser!!.clientCertificate = finalAlias
userManager.updateUser(currentUser!!)
userManager.updateOrCreateUser(currentUser!!)
},
arrayOf("RSA", "EC"),
null,
@ -601,7 +601,7 @@ class SettingsController : NewBaseController(R.layout.controller_settings) {
}
if ((!TextUtils.isEmpty(displayName) && !(displayName == currentUser!!.displayName))) {
currentUser!!.displayName = displayName
userManager.updateUser(currentUser!!)
userManager.updateOrCreateUser(currentUser!!)
binding.displayNameText.text = currentUser!!.displayName
}
},

View file

@ -123,7 +123,7 @@ class UserManager internal constructor(private val userRepository: UsersReposito
}.toSingle()
}
fun updateUser(user: User): Single<Int> {
fun updateOrCreateUser(user: User): Single<Int> {
return Single.fromCallable {
when (user.id) {
null -> userRepository.insertUser(user).toInt()