web: fixing old refactor damage
concourse/concourse#2884 for real this time
@@ -144,16 +144,6 @@ init ports flags =
)
-handle : a -> a -> Result e v -> a
-handle onError onSuccess result =
- case result of
- Ok _ ->
- onSuccess
-
- Err _ ->
- onError
-
-
substateLens : Monocle.Lens.Lens Model (Maybe SubState.SubState)
substateLens =
Monocle.Lens.Lens (.state >> Result.toMaybe)
@@ -191,11 +181,6 @@ substate csrfToken highDensity ( now, apiData ) =
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
- let
- reload =
- Cmd.batch <|
- handle [] [ fetchData ] model.state
- in
case msg of
Noop ->
( model, Cmd.none )
@@ -242,7 +227,7 @@ update msg model =
AutoRefresh _ ->
( model
- , reload
+ , fetchData
)
KeyPressed keycode ->
@@ -361,7 +346,7 @@ update msg model =
)
LogOut ->
- ( { model | state = Err NotAsked }, Cmd.batch [ NewTopBar.logOut, reload ] )
+ ( { model | state = Err NotAsked }, Cmd.batch [ NewTopBar.logOut, fetchData ] )
LoggedOut (Ok ()) ->
let
