Skip to content

Commit

Permalink
Update name to match server (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristhianescobar authored Jul 22, 2024
1 parent daaee1b commit e9d52fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun ProfileHeader(
lastName: String,
email: String
) {
val fullName = if(firstName.isNotEmpty() || lastName.isNotEmpty()) "$firstName $lastName" else ""
val fullName = "${firstName.trim()} ${lastName.trim()}".trim()

Text(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ data class User(
val confirmPassword: String? = null
)

fun User.fullName(): String? {
return if(!firstName.isNullOrBlank() && !lastName.isNullOrBlank()) "$firstName $lastName" else null
fun User.fullName(): String {
return "${firstName.orEmpty().trim()} ${lastName.orEmpty().trim()}".trim()
}

fun User.canEditName(): Boolean {
Expand Down

0 comments on commit e9d52fc

Please sign in to comment.