blob: ade5761c356740e568ebc621bf2b066ad8460c0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
module Update.SignIn
( updateSignIn
) where
import Model.View.SignInView exposing (..)
import Model.Action.SignInAction exposing (..)
import Model.Translations exposing (getMessage, Translations)
updateSignIn : Translations -> SignInAction -> SignInView -> SignInView
updateSignIn 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
}
|