From e1f8664779b0075ad7da76e4290c1fe8f9b76b94 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 16 Mar 2015 22:19:06 +0100 Subject: Adding a play / pause button --- src/Update/UpdateTimer.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Update/UpdateTimer.elm') diff --git a/src/Update/UpdateTimer.elm b/src/Update/UpdateTimer.elm index b3be088..3eba549 100644 --- a/src/Update/UpdateTimer.elm +++ b/src/Update/UpdateTimer.elm @@ -7,15 +7,15 @@ import Model.Timer (..) import Model.Id (..) type TimerAction = - ToggleRunning - | Restart + Restart + | ToggleRunning | Stop updateTimer : TimerAction -> Timer -> Timer updateTimer action timer = case action of ToggleRunning -> - { timer | isRunning <- not timer.isRunning } + { timer | isRunning <- timer.currentTime > 0.0 && not timer.isRunning } Restart -> { timer | isRunning <- True -- cgit v1.2.3