diff --git a/app/src/main/java/br/com/connectattoo/ui/home/HomeUserViewModel.kt b/app/src/main/java/br/com/connectattoo/ui/home/HomeUserViewModel.kt index c38355d..c7aca3f 100644 --- a/app/src/main/java/br/com/connectattoo/ui/home/HomeUserViewModel.kt +++ b/app/src/main/java/br/com/connectattoo/ui/home/HomeUserViewModel.kt @@ -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, diff --git a/app/src/main/java/br/com/connectattoo/ui/tattooclientprofile/TattooClientProfileViewModel.kt b/app/src/main/java/br/com/connectattoo/ui/tattooclientprofile/TattooClientProfileViewModel.kt index 68ee357..1842e30 100644 --- a/app/src/main/java/br/com/connectattoo/ui/tattooclientprofile/TattooClientProfileViewModel.kt +++ b/app/src/main/java/br/com/connectattoo/ui/tattooclientprofile/TattooClientProfileViewModel.kt @@ -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}", )