From 91c75a388d232a18ef71a171297186c60a02cd49 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 5 Sep 2024 00:00:39 +0200 Subject: [PATCH] Showing account selection composable if more than one account is available --- .../banking/ui/dialogs/TransferMoneyDialog.kt | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt index af89e5f..e180698 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt @@ -116,16 +116,18 @@ fun TransferMoneyDialog( onDismiss = onDismiss, onConfirm = { confirmCalled() } ) { - Select( - "Konto", "Alle Konten anzeigen", - accountsSupportingTransferringMoney, senderAccount, { senderAccount = it }, - { account -> "${accountsToUserAccount[account]?.displayName} ${account.displayName}" }, - { BankIcon(accountsToUserAccount[senderAccount]) } - ) { account -> - Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { - BankIcon(accountsToUserAccount[account], Modifier.padding(end = 6.dp)) + if (accountsSupportingTransferringMoney.size > 1) { + Select( + "Konto", "Alle Konten anzeigen", + accountsSupportingTransferringMoney, senderAccount, { senderAccount = it }, + { account -> "${accountsToUserAccount[account]?.displayName} ${account.displayName}" }, + { BankIcon(accountsToUserAccount[senderAccount]) } + ) { account -> + Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { + BankIcon(accountsToUserAccount[account], Modifier.padding(end = 6.dp)) - Text("${accountsToUserAccount[account]?.displayName} ${account.displayName}") + Text("${accountsToUserAccount[account]?.displayName} ${account.displayName}") + } } }