Extracted isDecoupledMethod

This commit is contained in:
dankito 2024-09-08 18:09:31 +02:00
parent 9d5826ac3c
commit b61b1cb5b7
1 changed files with 5 additions and 3 deletions

View File

@ -35,7 +35,9 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
val challenge = tanChallengeReceived.tanChallenge
val isNotADecoupledTanMethod = !!!challenge.selectedTanMethod.type.isDecoupledMethod
val isDecoupledMethod = challenge.selectedTanMethod.type.isDecoupledMethod
val isNotADecoupledTanMethod = !!!isDecoupledMethod
var tanImageHeight by remember { mutableStateOf(250) }
val minTanImageHeight = 100
@ -46,7 +48,7 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
var enteredTan by remember { mutableStateOf("") }
if (!!!isNotADecoupledTanMethod) {
if (isDecoupledMethod) {
challenge.addUserApprovedDecoupledTanCallback {
onDismiss()
}
@ -65,7 +67,7 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
useMoreThanPlatformDefaultWidthOnMobile = true,
confirmButtonTitle = if (isNotADecoupledTanMethod) "OK" else "",
confirmButtonEnabled = enteredTan.length > 2 && isNotADecoupledTanMethod,
showProgressIndicatorOnConfirmButton = !!!isNotADecoupledTanMethod,
showProgressIndicatorOnConfirmButton = isDecoupledMethod,
onConfirm = { confirmCalled() },
onDismiss = {
tanChallengeReceived.callback(EnterTanResult(null))