bugfix
This commit is contained in:
parent
b7de38b9c7
commit
ed474409e8
@ -77,7 +77,11 @@ class UserServiceST(
|
|||||||
if (!tokenManager.hasTokens()) {
|
if (!tokenManager.hasTokens()) {
|
||||||
throw RuntimeException("access token is null")
|
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>{
|
suspend fun getInfoByLogin(login: String): Result<UserDTO>{
|
||||||
if (!tokenManager.hasTokens()) {
|
if (!tokenManager.hasTokens()) {
|
||||||
|
@ -74,11 +74,8 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
|
|||||||
|
|
||||||
if (userDTO.roles.any { it.name == "ROLE_ADMIN" }) {
|
if (userDTO.roles.any { it.name == "ROLE_ADMIN" }) {
|
||||||
binding.buttonSearch.visibility = View.VISIBLE
|
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() {
|
private fun hideButtons() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user