diff options
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 + } |