Only showing account selection box if there are any SEPA accounts

This commit is contained in:
dankito 2024-10-04 01:26:10 +02:00
parent c89220bc0c
commit 5d00bbf77e
1 changed files with 25 additions and 23 deletions

View File

@ -101,32 +101,34 @@ fun CreateEpcQrCodeScreen(onClosed: () -> Unit) {
}
Select(
"Für Konto",
accountsWithIban,
selectedAccount,
{ account ->
selectedAccount = account
if (accountsWithIban.size > 1) {
Select(
"Für Konto",
accountsWithIban,
selectedAccount,
{ account ->
selectedAccount = account
if (account != null) {
iban = account.iban ?: ""
bic = banks.firstOrNull { it.id == selectedAccount?.bankId }?.bic ?: ""
receiverName = account.accountHolderName
if (account != null) {
iban = account.iban ?: ""
bic = banks.firstOrNull { it.id == selectedAccount?.bankId }?.bic ?: ""
receiverName = account.accountHolderName
amountFocus.requestFocus()
}
},
{ account -> account?.displayName ?: "" },
leadingIcon = bankOfSelectedAccount?.let { { BankIcon(bankOfSelectedAccount) } },
dropDownItemContent = { account ->
Row(verticalAlignment = Alignment.CenterVertically) {
BankIcon(banks.firstOrNull { it.id == account?.bankId }, Modifier.padding(end = 6.dp))
amountFocus.requestFocus()
}
},
{ account -> account?.displayName ?: "" },
leadingIcon = bankOfSelectedAccount?.let { { BankIcon(bankOfSelectedAccount) } },
dropDownItemContent = { account ->
Row(verticalAlignment = Alignment.CenterVertically) {
BankIcon(banks.firstOrNull { it.id == account?.bankId }, Modifier.padding(end = 6.dp))
Text(account?.displayName ?: "")
}
},
modifier = Modifier.fillMaxWidth().padding(top = 16.dp, bottom = 8.dp)
)
Text(account?.displayName ?: "")
}
},
modifier = Modifier.fillMaxWidth().padding(top = 16.dp, bottom = 8.dp)
)
}
OutlinedTextField(
label = { Text("Empfänger*in") },