diff options
Diffstat (limited to 'src/client/SignIn/Update.elm')
-rw-r--r-- | src/client/SignIn/Update.elm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/client/SignIn/Update.elm b/src/client/SignIn/Update.elm new file mode 100644 index 0000000..98de777 --- /dev/null +++ b/src/client/SignIn/Update.elm @@ -0,0 +1,31 @@ +module SignIn.Update exposing + ( update + ) + +import SignIn.Model exposing (..) +import SignIn.Msg exposing (..) + +import Model.Translations exposing (getMessage, Translations) + +update : Translations -> Msg -> Model -> Model +update translations msg signInView = + case msg of + UpdateLogin login -> + { signInView | + login = login + } + WaitingServer -> + { signInView + | waitingServer = True + } + ValidLogin -> + { signInView + | login = "" + , result = Just (Ok (getMessage translations "SignInEmailSent")) + , waitingServer = False + } + ErrorLogin message -> + { signInView + | result = Just (Err message) + , waitingServer = False + } |