mirror of
https://github.com/Steffo99/twom.git
synced 2024-11-25 01:24:24 +00:00
Display an X in case of error when inputting the homeserver
This commit is contained in:
parent
9de4425287
commit
b1e4051b60
2 changed files with 5 additions and 3 deletions
|
@ -32,7 +32,7 @@ import kotlinx.coroutines.launch
|
|||
import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
|
||||
|
||||
@Composable
|
||||
fun LoginFragment() {
|
||||
fun HomeserverFragment() {
|
||||
TwoMMatrixProvider {
|
||||
TwoMTheme {
|
||||
HomeserverContents()
|
||||
|
@ -98,8 +98,7 @@ fun HomeserverContents() {
|
|||
))
|
||||
}
|
||||
catch(e: Throwable) {
|
||||
Log.e("LoginFragment", "Failed to get flows for homeserver", e)
|
||||
homeserverFieldState = HomeserverFieldState.Done
|
||||
homeserverFieldState = HomeserverFieldState.Error
|
||||
homeserverFlowValid = false
|
||||
return@ValidateFlows
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package eu.steffo.twom.ui.input
|
|||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Build
|
||||
import androidx.compose.material.icons.filled.Check
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.Create
|
||||
import androidx.compose.material.icons.filled.Send
|
||||
import androidx.compose.material3.Icon
|
||||
|
@ -19,6 +20,7 @@ enum class HomeserverFieldState {
|
|||
Empty,
|
||||
Waiting,
|
||||
Validating,
|
||||
Error,
|
||||
Done,
|
||||
}
|
||||
|
||||
|
@ -51,6 +53,7 @@ fun HomeserverField(
|
|||
HomeserverFieldState.Empty -> Icons.Default.Build
|
||||
HomeserverFieldState.Waiting -> Icons.Default.Create
|
||||
HomeserverFieldState.Validating -> Icons.Default.Send
|
||||
HomeserverFieldState.Error -> Icons.Default.Close
|
||||
HomeserverFieldState.Done -> Icons.Default.Check
|
||||
},
|
||||
LocalContext.current.getString(R.string.homeserver_trailingicon_validating_description)
|
||||
|
|
Loading…
Reference in a new issue