Merge pull request #878 from eikek/fix/877-language-per-source

Update language dropdown for new data
This commit is contained in:
mergify[bot] 2021-06-14 19:18:43 +00:00 committed by GitHub
commit 5f04ee3703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,6 +155,7 @@ update flags msg model =
, enabled = t.source.enabled , enabled = t.source.enabled
, folder = t.source.folder , folder = t.source.folder
, fileFilter = t.source.fileFilter , fileFilter = t.source.fileFilter
, language = t.source.language
} }
newModel = newModel =
@ -168,6 +169,7 @@ update flags msg model =
, enabled = t.source.enabled , enabled = t.source.enabled
, folderId = t.source.folder , folderId = t.source.folder
, fileFilter = t.source.fileFilter , fileFilter = t.source.fileFilter
, language = t.source.language
} }
mkIdName id = mkIdName id =
@ -189,12 +191,21 @@ update flags msg model =
Nothing -> Nothing ->
[] []
langSel =
case Maybe.andThen Data.Language.fromString t.source.language of
Just lang ->
[ lang ]
Nothing ->
[]
tags = tags =
Comp.Dropdown.SetSelection t.tags.items Comp.Dropdown.SetSelection t.tags.items
in in
Util.Update.andThen1 Util.Update.andThen1
[ update flags (FolderDropdownMsg (Comp.Dropdown.SetSelection sel)) [ update flags (FolderDropdownMsg (Comp.Dropdown.SetSelection sel))
, update flags (TagDropdownMsg tags) , update flags (TagDropdownMsg tags)
, update flags (LanguageMsg (Comp.Dropdown.SetSelection langSel))
] ]
newModel newModel