diff --git a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileState.kt b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileState.kt index fdfb8ce..fbc84aa 100644 --- a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileState.kt +++ b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileState.kt @@ -14,7 +14,7 @@ data class ProfileState( var lastOpen: String = "", var job: String = "", var isUnauthorized: Boolean = false, - val visits: List = listOf() + var visits: List = listOf() ) { fun deserialize(o: UserDTO, context: Context) { val dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") diff --git a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt index f55d1e1..57528f6 100644 --- a/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt +++ b/presentation/src/main/java/com/nto/presentation/screens/profileScreen/ProfileViewModel.kt @@ -38,8 +38,13 @@ class ProfileViewModel @Inject constructor( viewModelScope.launch(Dispatchers.IO) { _isLoading = true val result = useCase.getInfo() - //val visits = useCase.get - _state.tryEmit(ProfileState().apply { deserialize(result, context) }) + val visitsResult = useCase.getVisits() + _state.tryEmit(ProfileState().apply { + deserialize(result, context) + if(!visitsResult.isError) { + visits = visitsResult.data!! + } + }) _isLoading = false } }