mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Fix display name length
This commit is contained in:
parent
ad2bf6e344
commit
e3685f65f8
@ -44,8 +44,10 @@ internal class PickDisplayNameViewModel(
|
||||
|
||||
when {
|
||||
displayName.isEmpty() -> { _states.update { it.copy(isTextErrorColor = true, error = R.string.displayNameErrorDescription) } }
|
||||
displayName.length > NAME_PADDED_LENGTH -> { _states.update { it.copy(isTextErrorColor = true, error = R.string.displayNameErrorDescriptionShorter) } }
|
||||
displayName.toByteArray().size > NAME_PADDED_LENGTH -> { _states.update { it.copy(isTextErrorColor = true, error = R.string.displayNameErrorDescriptionShorter) } }
|
||||
else -> {
|
||||
_states.update { it.copy(isTextErrorColor = false, error = null) }
|
||||
|
||||
prefs.setProfileName(displayName)
|
||||
|
||||
if (!loadFailed) {
|
||||
|
@ -308,7 +308,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
||||
Toast.makeText(this, R.string.activity_settings_display_name_missing_error, Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
if (displayName.toByteArray().size > ProfileManagerProtocol.Companion.NAME_PADDED_LENGTH) {
|
||||
if (displayName.toByteArray().size > ProfileManagerProtocol.NAME_PADDED_LENGTH) {
|
||||
Toast.makeText(this, R.string.activity_settings_display_name_too_long_error, Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user