mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Fix setting default in dropdown
This commit is contained in:
parent
237b960625
commit
8677eca6d4
@ -54,7 +54,7 @@ init flags sett =
|
|||||||
in
|
in
|
||||||
( { enabled = sett.enabled
|
( { enabled = sett.enabled
|
||||||
, categoryModel = Comp.FixedDropdown.initString []
|
, categoryModel = Comp.FixedDropdown.initString []
|
||||||
, category = Nothing
|
, category = sett.category
|
||||||
, scheduleModel = cem
|
, scheduleModel = cem
|
||||||
, schedule = Data.Validated.Unknown newSchedule
|
, schedule = Data.Validated.Unknown newSchedule
|
||||||
, itemCountModel = Comp.IntField.init (Just 0) Nothing True "Item Count"
|
, itemCountModel = Comp.IntField.init (Just 0) Nothing True "Item Count"
|
||||||
@ -92,7 +92,12 @@ update flags msg model =
|
|||||||
in
|
in
|
||||||
( { model
|
( { model
|
||||||
| categoryModel = Comp.FixedDropdown.initString categories
|
| categoryModel = Comp.FixedDropdown.initString categories
|
||||||
, category = List.head categories
|
, category =
|
||||||
|
if model.category == Nothing then
|
||||||
|
List.head categories
|
||||||
|
|
||||||
|
else
|
||||||
|
model.category
|
||||||
}
|
}
|
||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user