Skip to content

Commit

Permalink
Removing ugly code + increased number of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
octogradiste authored and violoncelloCH committed Mar 28, 2024
1 parent 40f91b0 commit 50a8c18
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,20 @@ fun AuthenticationScreen(
onAuthenticate: (email: String, password: String) -> Unit,
) {
Box(modifier = Modifier.padding(24.dp)) {
// This would be much cleaner, but jacoco doesn't like it
/*
when (state) {
is AuthenticationState.SignedOut -> AuthenticationForm(action, onAuthenticate)
is AuthenticationState.SignedOut ->
AuthenticationForm(
action = action,
onAuthenticate = onAuthenticate,
)
is AuthenticationState.SigningIn -> Text("Signing in...")
is AuthenticationState.SignedIn -> Text("Signed in")
is AuthenticationState.Error ->
AuthenticationForm(action, onAuthenticate, error = state.message)
}
*/
if (state is AuthenticationState.SignedOut) {
AuthenticationForm(action, onAuthenticate)
} else if (state is AuthenticationState.SigningIn) {
Text("Signing in...")
} else if (state is AuthenticationState.Error) {
AuthenticationForm(action, onAuthenticate, error = state.message)
} else {
Text("Signed in")
AuthenticationForm(
action = action,
onAuthenticate = onAuthenticate,
error = state.message,
)
}
}
}

0 comments on commit 50a8c18

Please sign in to comment.