Hide password field in outgoing server settings when not needed

This commit is contained in:
cketti 2023-07-03 18:15:36 +02:00
parent 37ea82bd8f
commit ba07e162e4
2 changed files with 14 additions and 8 deletions

View file

@ -145,14 +145,16 @@ internal fun AccountOutgoingConfigContent(
)
}
item {
PasswordInput(
password = state.password.value,
errorMessage = state.password.error?.toResourceString(resources),
onPasswordChange = { onEvent(Event.PasswordChanged(it)) },
isRequired = true,
contentPadding = defaultItemPadding(),
)
if (state.isPasswordFieldVisible) {
item {
PasswordInput(
password = state.password.value,
errorMessage = state.password.error?.toResourceString(resources),
onPasswordChange = { onEvent(Event.PasswordChanged(it)) },
isRequired = true,
contentPadding = defaultItemPadding(),
)
}
}
item {

View file

@ -0,0 +1,4 @@
package app.k9mail.feature.account.setup.ui.outgoing
internal val AccountOutgoingConfigContract.State.isPasswordFieldVisible: Boolean
get() = authenticationType.isPasswordRequired