diff options
author | Joris | 2016-03-27 19:44:40 +0200 |
---|---|---|
committer | Joris | 2016-03-27 19:44:40 +0200 |
commit | 5f6c66e4c3cf02e5b1c0a1fac6036b86be06a992 (patch) | |
tree | 510b3b65d13a8003b092b4c9fe62f6456750cd38 /src/client/elm/SignIn/Update.elm | |
parent | 9b7546b99411a8364eccf6b0262a3c0c7d82380c (diff) |
Regroup signIn modules
Diffstat (limited to 'src/client/elm/SignIn/Update.elm')
-rw-r--r-- | src/client/elm/SignIn/Update.elm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/client/elm/SignIn/Update.elm b/src/client/elm/SignIn/Update.elm new file mode 100644 index 0000000..f4152a6 --- /dev/null +++ b/src/client/elm/SignIn/Update.elm @@ -0,0 +1,31 @@ +module SignIn.Update + ( update + ) where + +import SignIn.Model exposing (..) +import SignIn.Action exposing (..) + +import Model.Translations exposing (getMessage, Translations) + +update : Translations -> Action -> Model -> Model +update translations action signInView = + case action of + UpdateLogin login -> + { signInView | + login = login + } + WaitingServer -> + { signInView + | waitingServer = True + } + ValidLogin -> + { signInView + | login = "" + , result = Just (Ok (getMessage "SignInEmailSent" translations)) + , waitingServer = False + } + ErrorLogin message -> + { signInView + | result = Just (Err message) + , waitingServer = False + } |