From 3c1449ac3b80c5dc11334f5773ad44b130c8cb7e Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 31 May 2023 08:47:57 -0600 Subject: [PATCH] Hide archived categories in transaction forms Signed-off-by: William Brawner --- .../budget/ui/recurringtransaction/RecurringTransactionForm.kt | 3 ++- .../java/com/wbrawner/budget/ui/transaction/TransactionForm.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/wbrawner/budget/ui/recurringtransaction/RecurringTransactionForm.kt b/android/src/main/java/com/wbrawner/budget/ui/recurringtransaction/RecurringTransactionForm.kt index 6139933..cb69cfd 100644 --- a/android/src/main/java/com/wbrawner/budget/ui/recurringtransaction/RecurringTransactionForm.kt +++ b/android/src/main/java/com/wbrawner/budget/ui/recurringtransaction/RecurringTransactionForm.kt @@ -117,7 +117,8 @@ fun RecurringTransactionForm(store: Store) { setAmount = setAmount, expense = expense, setExpense = setExpense, - categories = state.categories?.filter { c -> c.expense == expense } ?: emptyList(), + categories = state.categories?.filter { c -> c.expense == expense && !c.archived } + ?: emptyList(), category = category, setCategory = setCategory ) { diff --git a/android/src/main/java/com/wbrawner/budget/ui/transaction/TransactionForm.kt b/android/src/main/java/com/wbrawner/budget/ui/transaction/TransactionForm.kt index d4c0f9a..99a6cfe 100644 --- a/android/src/main/java/com/wbrawner/budget/ui/transaction/TransactionForm.kt +++ b/android/src/main/java/com/wbrawner/budget/ui/transaction/TransactionForm.kt @@ -111,7 +111,8 @@ fun TransactionForm(store: Store) { setAmount = setAmount, expense = expense, setExpense = setExpense, - categories = state.categories?.filter { c -> c.expense == expense } ?: emptyList(), + categories = state.categories?.filter { c -> c.expense == expense && !c.archived } + ?: emptyList(), category = category, setCategory = setCategory ) {