diff options
author | Joris Guyonvarch | 2015-05-10 16:32:08 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-05-10 16:32:08 +0200 |
commit | 62fee9133f36f655c1ed83e0c2e85394f9948bf5 (patch) | |
tree | 8eb779ae9f41567b5934ee1146e0523dbd6090a2 /src/Update | |
parent | 1f06679a739ba0be3b6b91c10bfd762a06c9573a (diff) |
Amelioring UX
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 |