aboutsummaryrefslogtreecommitdiff
path: root/src/Update
diff options
context:
space:
mode:
Diffstat (limited to 'src/Update')
-rw-r--r--src/Update/Update.elm18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Update/Update.elm b/src/Update/Update.elm
index 48d3008..f96a128 100644
--- a/src/Update/Update.elm
+++ b/src/Update/Update.elm
@@ -90,14 +90,10 @@ update action model =
ValidTimerEdition ->
case model.timerEdition of
Just timerEdition ->
- if List.isEmpty timerEdition.numbers
- then
- { model | timerEdition <- Nothing }
- else
- { model
- | timers <- updateTimerTime timerEdition model.timers
- , timerEdition <- Nothing
- }
+ { model
+ | timers <- updateTimerTime timerEdition model.timers
+ , timerEdition <- Nothing
+ }
Nothing ->
{ model | timerEdition <- Nothing }
ReadOnly ->
@@ -111,7 +107,11 @@ update action model =
updateTimerTime : TimerEdition -> Dict Id Timer -> Dict Id Timer
updateTimerTime timerEdition =
- Dict.update timerEdition.id (Maybe.map (updateTimer (SetTime (toTime timerEdition.numbers))))
+ if List.isEmpty timerEdition.numbers
+ then
+ identity
+ else
+ Dict.update timerEdition.id (Maybe.map (updateTimer (SetTime (toTime timerEdition.numbers))))
isRemoveKeyCode : KeyCode -> Bool
isRemoveKeyCode = (==) 8