From 62fee9133f36f655c1ed83e0c2e85394f9948bf5 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 10 May 2015 16:32:08 +0200 Subject: Amelioring UX --- src/Update/UpdateTimer.elm | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'src/Update/UpdateTimer.elm') 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 -- cgit v1.2.3