Skip to content

Commit

Permalink
fix: add first name user home screen
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeTranin committed Apr 24, 2024
1 parent ea35bca commit c2657d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class HomeUserViewModel: ViewModel() {
_uiStateFlow.value = UiState.Error
}
it.data?.let {clientProfile ->
val firstName = clientProfile.displayName?.split(" ")?.get(0)
_state = _state.copy(
displayName = clientProfile.displayName,
displayName = firstName,
username = clientProfile.username,
birthDate = clientProfile.birthDate,
imageProfile = clientProfile.imageProfile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@ class TattooClientProfileViewModel : ViewModel() {

if (clientProfile.birthDate != null) {
val age = calculateDateBirth(clientProfile.birthDate)

_state = _state.copy(txtAgeAndEmail = "$age | ")
}



if (clientProfile.imageProfile != null) {
_state = _state.copy(userImage = clientProfile.imageProfile)
}

_state = _state.copy(
txtNameUser = "@${clientProfile.displayName}",
)
Expand Down

0 comments on commit c2657d2

Please sign in to comment.