checkpoint 0 #5

Open
student-e-klyukin wants to merge 15 commits from WindWin-org/NTO-2026-Android-TeamTask-Template:main into main
2 changed files with 10 additions and 3 deletions
Showing only changes of commit 3c4702b0b0 - Show all commits

View File

@ -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,
) )

View File

@ -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
) )
} }
} }