on master help sign in
Keep selected category when updating ciphers (#32)
40dfa7diko
frontend/Main.elm+3−6
@@ -432,9 +432,6 @@ update msg model =
432 _ ->
432 _ ->
433 False
433 False
434 )
434 )
435−
436− pageModel =
437− Ciphers.init ciphersCallbacks ciphers
438 in
435 in
439 ( if ciphersShown then
436 ( if ciphersShown then
440 { model
437 { model
@@ -443,8 +440,8 @@ update msg model =
443 |> Nonempty.map
440 |> Nonempty.map
444 (\x ->
441 (\x ->
445 case x of
442 case x of
446− CiphersModel _ ->
443+ CiphersModel pageModel ->
447− CiphersModel pageModel
444+ CiphersModel (Ciphers.updateCiphers ciphers pageModel)
448
445
449 other ->
446 other ->
450 other
447 other
@@ -452,7 +449,7 @@ update msg model =
452 }
449 }
453
450
454 else
451 else
455− appendPageStack <| CiphersModel pageModel
452+ appendPageStack <| CiphersModel (Ciphers.init ciphersCallbacks ciphers)
456 , Cmd.none
453 , Cmd.none
457 )
454 )
458
455
frontend/Pages/Ciphers.elm+17−1
@@ -1,4 +1,15 @@
1−module Pages.Ciphers exposing (Callbacks, Model, Msg, event, init, menuConfig, title, update, view)
1+module Pages.Ciphers exposing
2+ ( Callbacks
3+ , Model
4+ , Msg
5+ , event
6+ , init
7+ , menuConfig
8+ , title
9+ , update
10+ , updateCiphers
11+ , view
12+ )
2
13
3import Bridge
14import Bridge
4import GlobalEvents
15import GlobalEvents
@@ -26,6 +37,11 @@ type alias Model emsg =
26 }
37 }
27
38
28
39
40+updateCiphers : Bridge.Sub_LoadCiphers_List -> Model emsg -> Model emsg
41+updateCiphers ciphers model =
42+ { model | ciphers = ciphers }
43+
44+
29type CiphersFilter
45type CiphersFilter
30 = AllCiphers
46 = AllCiphers
31 | SpecificCiphers Bridge.CipherType
47 | SpecificCiphers Bridge.CipherType