aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Update.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Update.elm')
-rw-r--r--src/client/elm/Update.elm8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/elm/Update.elm b/src/client/elm/Update.elm
index a78be68..bfc3bf6 100644
--- a/src/client/elm/Update.elm
+++ b/src/client/elm/Update.elm
@@ -20,8 +20,6 @@ import Model.View.LoggedInView exposing (..)
import Update.LoggedIn exposing (updateLoggedIn)
import Update.SignIn exposing (updateSignIn)
-import SimpleHTTP exposing (post)
-
update : Action -> Model -> (Model, Effects Action)
update action model =
case action of
@@ -32,14 +30,15 @@ update action model =
SignIn assertion ->
( applySignIn model (SignInAction.WaitingServer)
, Server.signIn assertion
+ |> Task.map GoLoggedInView
|> flip Task.onError (\_ ->
Task.succeed (UpdateSignIn (SignInAction.ErrorLogin (getMessage "ErrorSignIn" model.translations)))
)
|> Effects.task
)
- GoLoggedInView users me monthlyPayments payments paymentsCount payers ->
- ( { model | view = V.LoggedInView (initLoggedInView users me monthlyPayments payments paymentsCount payers) }
+ GoLoggedInView init ->
+ ( { model | view = V.LoggedInView (initLoggedInView init) }
, Effects.none
)
@@ -58,6 +57,7 @@ update action model =
SignOut ->
( model
, Server.signOut
+ |> Task.map (always GoSignInView)
|> flip Task.onError (always <| Task.succeed NoOp)
|> Effects.task
)