diff options
Diffstat (limited to 'src/client/Update.elm')
-rw-r--r-- | src/client/Update.elm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/Update.elm b/src/client/Update.elm index f88a3a2..be7538a 100644 --- a/src/client/Update.elm +++ b/src/client/Update.elm @@ -4,6 +4,8 @@ module Update , updateModel ) where +import Time exposing (Time) + import Model exposing (Model) import Model.Payment exposing (Payments) import Model.View as V @@ -15,10 +17,11 @@ import Update.Payment exposing (..) type Action = NoOp + | UpdateTime Time | GoSignInView | SignInError String | UpdateSignIn SignInAction - | GoPaymentView Payments + | GoPaymentView String Payments | UpdatePayment PaymentAction actions : Signal.Mailbox Action @@ -29,10 +32,12 @@ updateModel action model = case action of NoOp -> model + UpdateTime time -> + { model | currentTime <- time } GoSignInView -> { model | view <- V.SignInView initSignInView } - GoPaymentView payments -> - { model | view <- V.PaymentView (initPaymentView payments) } + GoPaymentView userName payments -> + { model | view <- V.PaymentView (initPaymentView userName payments) } SignInError msg -> let signInView = { initSignInView | result <- Just (Err msg) } in { model | view <- V.SignInView signInView } @@ -45,6 +50,6 @@ updateModel action model = UpdatePayment paymentAction -> case model.view of V.PaymentView paymentView -> - { model | view <- V.PaymentView (updatePayment paymentAction paymentView) } + { model | view <- V.PaymentView (updatePayment model paymentAction paymentView) } _ -> model |