From b61b1cb5b7b1bb4f693852b2b4df410a3f2782d3 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 8 Sep 2024 18:09:31 +0200 Subject: [PATCH] Extracted isDecoupledMethod --- .../net/codinux/banking/ui/dialogs/EnterTanDialog.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt index 952faad..4182f92 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/EnterTanDialog.kt @@ -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))