diff options
Diffstat (limited to 'src/client/elm/Update/LoggedIn/Account.elm')
-rw-r--r-- | src/client/elm/Update/LoggedIn/Account.elm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/elm/Update/LoggedIn/Account.elm b/src/client/elm/Update/LoggedIn/Account.elm index cf4c834..c7a66dd 100644 --- a/src/client/elm/Update/LoggedIn/Account.elm +++ b/src/client/elm/Update/LoggedIn/Account.elm @@ -25,11 +25,11 @@ updateAccount : AccountAction -> Account -> Account updateAccount action account = case action of ToggleDetail -> - { account | visibleDetail <- not account.visibleDetail } + { account | visibleDetail = not account.visibleDetail } UpdatePayer userId creation amountDiff -> - { account | payers <- updatePayers account.payers userId creation amountDiff } + { account | payers = updatePayers account.payers userId creation amountDiff } ToggleIncomeEdition -> - { account | incomeEdition <- + { account | incomeEdition = if isJust account.incomeEdition then Nothing else Just (initIncomeEdition (Maybe.withDefault 0 (getCurrentIncome account))) @@ -37,28 +37,28 @@ updateAccount action account = UpdateIncomeEdition income -> case account.incomeEdition of Just incomeEdition -> - { account | incomeEdition <- Just { incomeEdition | income <- income } } + { account | incomeEdition = Just { incomeEdition | income = income } } Nothing -> account UpdateEditionError error -> case account.incomeEdition of Just incomeEdition -> - { account | incomeEdition <- Just { incomeEdition | error <- Just error } } + { account | incomeEdition = Just { incomeEdition | error = Just error } } Nothing -> account UpdateIncome currentTime amount -> { account - | payers <- + | payers = account.payers |> Dict.update account.me (\mbPayer -> case mbPayer of Just payer -> Just { payer - | incomes <- payer.incomes ++ [{ creation = currentTime, amount = amount }] + | incomes = payer.incomes ++ [{ creation = currentTime, amount = amount }] } Nothing -> Nothing ) - , incomeEdition <- Nothing + , incomeEdition = Nothing } |