checkpoint 0 #5
@ -110,10 +110,17 @@ private fun Content(
|
|||||||
) {
|
) {
|
||||||
Text(stringResource(R.string.auth_sign_in))
|
Text(stringResource(R.string.auth_sign_in))
|
||||||
}
|
}
|
||||||
if (state.error != null) {
|
if (state.error != "Connection refused" && state.error != null) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.testTag(TestIds.Auth.ERROR),
|
modifier = Modifier.testTag(TestIds.Auth.ERROR),
|
||||||
text = state.error,
|
text = "Неизвестная ошибка: ${state.error}",
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = Color.Red,
|
||||||
|
)
|
||||||
|
} else if (state.error == "Connection refused") {
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.testTag(TestIds.Auth.ERROR),
|
||||||
|
text = "Отсутствует интернет-соединение",
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = Color.Red,
|
color = Color.Red,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class AuthViewModel : ViewModel() {
|
|||||||
onFailure = { error ->
|
onFailure = { error ->
|
||||||
updateStateIfData { oldState ->
|
updateStateIfData { oldState ->
|
||||||
oldState.copy(
|
oldState.copy(
|
||||||
error = "Неизвестная ошибка: ${error.message}"
|
error = error.message
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user