From 0cc4bed0283a694f67469827aa2638fc3949d0ff Mon Sep 17 00:00:00 2001 From: Dias Mashikov <50723693+diasmashikov@users.noreply.github.com> Date: Sat, 24 Feb 2024 04:41:17 -0500 Subject: [PATCH] Fix issue #2971 (#2982) * Fix issue #2971: Enabled adding categories for Account Transfers. In the commits and PRs I intend to display category of the account transfer * Removed the unused parameter --- .../com/ivy/transaction/EditTransactionScreen.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionScreen.kt b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionScreen.kt index a78906bd63..000ea8ba46 100644 --- a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionScreen.kt +++ b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionScreen.kt @@ -318,13 +318,11 @@ private fun BoxWithConstraintsScope.UI( ) } - if (transactionType != TransactionType.TRANSFER) { - Spacer(Modifier.height(32.dp)) + Spacer(Modifier.height(32.dp)) - Category(category = category, onChooseCategory = { - chooseCategoryModalVisible = true - }) - } + Category(category = category, onChooseCategory = { + chooseCategoryModalVisible = true + }) Spacer(Modifier.height(32.dp)) @@ -468,7 +466,7 @@ private fun BoxWithConstraintsScope.UI( onAmountChanged = { onAmountChanged(it) - if (shouldFocusCategory(category, transactionType)) { + if (shouldFocusCategory(category)) { chooseCategoryModalVisible = true } else if (shouldFocusTitle(titleTextFieldValue, transactionType)) { titleFocus.requestFocus() @@ -589,8 +587,7 @@ private fun BoxWithConstraintsScope.UI( private fun shouldFocusCategory( category: Category?, - type: TransactionType -): Boolean = category == null && type != TransactionType.TRANSFER +): Boolean = category == null private fun shouldFocusTitle( titleTextFieldValue: TextFieldValue,