Fixed back mapping unset Month (null)

This commit is contained in:
dankito 2024-09-07 00:01:22 +02:00
parent 8dd8852dc3
commit c1140c1836
1 changed files with 2 additions and 1 deletions

View File

@ -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)
)