diff options
Diffstat (limited to 'src/Update')
-rw-r--r-- | src/Update/UpdateTimer.elm | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/Update/UpdateTimer.elm b/src/Update/UpdateTimer.elm index 49593d0..08b9969 100644 --- a/src/Update/UpdateTimer.elm +++ b/src/Update/UpdateTimer.elm @@ -25,30 +25,22 @@ updateTimer action timer = Pause -> { timer | state <- Idle } ToggleRunning -> - if timer.state == Ringing - then - { timer - | currentTime <- initTime timer.initialTime - , state <- Running - } - else - { timer - | state <- - if timer.currentTime > 0 && timer.state == Idle - then Running - else Idle - } + { timer + | state <- + if timer.currentTime > 0 && timer.state == Idle + then Running + else Idle + } Stop -> { timer - | currentTime <- initTime timer.initialTime + | currentTime <- timer.initialTime , state <- Idle } SetTime time -> - let augmentedTime = time + 999 - in { timer - | initialTime <- time - , currentTime <- augmentedTime - } + { timer + | initialTime <- time + , currentTime <- time + } SubstractTime time -> if timer.state == Running then |