From c1140c18369175c78986ce92b7604fad2df6a419 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 7 Sep 2024 00:01:22 +0200 Subject: [PATCH] Fixed back mapping unset Month (null) --- .../kotlin/net/codinux/banking/ui/appskeleton/FilterBar.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/FilterBar.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/FilterBar.kt index 2caa552..5ac279e 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/FilterBar.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/FilterBar.kt @@ -13,6 +13,7 @@ import net.codinux.banking.ui.config.DI import net.codinux.banking.ui.config.Internationalization import net.codinux.banking.ui.forms.RoundedCornersCard import net.codinux.banking.ui.forms.Select +import net.codinux.banking.ui.model.TransactionsGrouping private val uiState = DI.uiState @@ -76,7 +77,7 @@ fun FilterBar() { label ="Monat", items = months, selectedItem = transactionsFilter.value.month?.let { months[it - 1] }, - onSelectedItemChanged = { month -> transactionsFilter.value.month = months.indexOf(month) + 1 }, + onSelectedItemChanged = { month -> transactionsFilter.value.month = (if (month == null) null else months.indexOf(month) + 1) }, getItemDisplayText = { month -> if (month == null) "" else month }, modifier = Modifier.width(selectBoxesWidth) )