This commit is contained in:
Izlydov 2025-02-20 14:45:43 +03:00
parent b7de38b9c7
commit ed474409e8
2 changed files with 6 additions and 5 deletions

View File

@ -77,7 +77,11 @@ class UserServiceST(
if (!tokenManager.hasTokens()) {
throw RuntimeException("access token is null")
}
return userRepository.getInfo(tokenManager.authTokenPair!!.accessToken)
val result = userRepository.getInfo(tokenManager.authTokenPair!!.accessToken)
result.map { dto ->
saveUserDTO(dto)
}
return result
}
suspend fun getInfoByLogin(login: String): Result<UserDTO>{
if (!tokenManager.hasTokens()) {

View File

@ -74,11 +74,8 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
if (userDTO.roles.any { it.name == "ROLE_ADMIN" }) {
binding.buttonSearch.visibility = View.VISIBLE
binding.rightsUsingSmartphone.text = "Пропуск действителен"
}
if (userDTO.roles.any { it.name == "ROLE_USER" }) {
binding.rightsUsingSmartphone.text = "Пропуск действителен"
}
binding.rightsUsingSmartphone.text = if (userDTO.isACSBlocked) "Пропуск действителен" else "Пропуск действителен"
}
private fun hideButtons() {