From b13be27a2d424a2b77d3f18af1a479f4ee101688 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 26 Sep 2024 04:49:06 +0200 Subject: [PATCH] Fixed that by default "null" has been displayed for amount --- .../net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 4f00804..45e0230 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 @@ -56,7 +56,7 @@ fun TransferMoneyDialog( var recipientName by remember { mutableStateOf(data.recipientName ?: "") } var recipientAccountIdentifier by remember { mutableStateOf(data.recipientAccountIdentifier ?: "") } - var amount by remember { mutableStateOf(data.amount.toString()) } + var amount by remember { mutableStateOf(data.amount?.toString() ?: "") } var paymentReference by remember { mutableStateOf(data.reference ?: "") } val accountSupportsInstantTransfer by remember(senderAccount) { derivedStateOf { senderAccount.supportsInstantTransfer } } var instantTransfer by remember { mutableStateOf(false) } @@ -205,8 +205,8 @@ fun TransferMoneyDialog( getItemTitle = { suggestion -> suggestion.amount.toString() }, onEnteredTextChanged = { amount = it }, onSelectedItemChanged = { - amount = it?.amount.toString() if (it != null) { + amount = it.amount.toString() paymentReference = it.reference } },