From 8677eca6d4af715259b1d6897b8a587b4f089782 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Tue, 1 Sep 2020 21:59:31 +0200 Subject: [PATCH] Fix setting default in dropdown --- .../webapp/src/main/elm/Comp/ClassifierSettingsForm.elm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index ef6a7638..23e440cd 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -54,7 +54,7 @@ init flags sett = in ( { enabled = sett.enabled , categoryModel = Comp.FixedDropdown.initString [] - , category = Nothing + , category = sett.category , scheduleModel = cem , schedule = Data.Validated.Unknown newSchedule , itemCountModel = Comp.IntField.init (Just 0) Nothing True "Item Count" @@ -92,7 +92,12 @@ update flags msg model = in ( { model | categoryModel = Comp.FixedDropdown.initString categories - , category = List.head categories + , category = + if model.category == Nothing then + List.head categories + + else + model.category } , Cmd.none )