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 c96f10a..829f9c9 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 @@ -121,12 +121,12 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () -> Row(Modifier.padding(top = 16.dp)) { ExposedDropdownMenuBox(showTanMediaDropDownMenu, { isExpanded -> showTanMediaDropDownMenu = isExpanded }, Modifier.fillMaxWidth()) { OutlinedTextField( - value = challenge.selectedTanMedium?.let { getTanMediumDisplayName(it) } ?: "", + value = challenge.selectedTanMedium?.let { it.displayName } ?: "", onValueChange = { Log.info { "TanMedia value changed: $it" }}, modifier = Modifier.fillMaxWidth(), label = { Text("TAN Medium") }, readOnly = true, - trailingIcon = { Icon(Icons.Filled.ArrowDropDown, "Alle TAN Verfahren anzeigen") } + trailingIcon = { Icon(Icons.Filled.ArrowDropDown, "Alle TAN Medien anzeigen") } ) ExposedDropdownMenu(showTanMediaDropDownMenu, { showTanMediaDropDownMenu = false }) { @@ -138,7 +138,7 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () -> // TODO: change TanMethod } ) { - Text(getTanMediumDisplayName(tanMedium)) + Text(tanMedium.displayName) } } } @@ -210,16 +210,4 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () -> textFieldFocus.requestFocus() } } -} - -fun getTanMediumDisplayName(tanMedium: net.codinux.banking.client.model.tan.TanMedium): String { - tanMedium.tanGenerator?.let { tanGenerator -> - return "${tanMedium.mediumName} ${tanGenerator.cardNumber}" - } - - tanMedium.mobilePhone?.let { mobilePhone -> - return "${tanMedium.mediumName} ${mobilePhone.concealedPhoneNumber ?: mobilePhone.phoneNumber}" - } - - return tanMedium.mediumName ?: "" } \ No newline at end of file