checkpoint 1

This commit is contained in:
Egor 2026-02-25 17:30:54 +03:00
parent 614640615f
commit 3c4702b0b0
2 changed files with 10 additions and 3 deletions

View File

@ -110,10 +110,17 @@ private fun Content(
) {
Text(stringResource(R.string.auth_sign_in))
}
if (state.error != null) {
if (state.error != "Connection refused" && state.error != null) {
Text(
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,
color = Color.Red,
)

View File

@ -41,7 +41,7 @@ class AuthViewModel : ViewModel() {
onFailure = { error ->
updateStateIfData { oldState ->
oldState.copy(
error = "Неизвестная ошибка: ${error.message}"
error = error.message
)
}
}