From afb9308a106a5cc09271e4420ed16c56dcd73f98 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 16 Mar 2015 20:53:02 +0100 Subject: Adding a stop button --- src/Update/UpdateTimer.elm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Update/UpdateTimer.elm') diff --git a/src/Update/UpdateTimer.elm b/src/Update/UpdateTimer.elm index d8861b7..40085ed 100644 --- a/src/Update/UpdateTimer.elm +++ b/src/Update/UpdateTimer.elm @@ -8,9 +8,15 @@ import Model.Id (..) type TimerAction = ToggleRunning + | Stop updateTimer : TimerAction -> Timer -> Timer updateTimer action timer = case action of ToggleRunning -> { timer | isRunning <- not timer.isRunning } + Stop -> + { timer + | isRunning <- False + , currentTime <- timer.initialTime + } -- cgit v1.2.3