aboutsummaryrefslogtreecommitdiff
path: root/src/Update
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-16 20:53:02 +0100
committerJoris Guyonvarch2015-03-16 20:53:02 +0100
commitafb9308a106a5cc09271e4420ed16c56dcd73f98 (patch)
tree90de17be17af00030cb30016918a93d1e783ffae /src/Update
parent4e5f27a5b1428b9ad190a87a6bf0d4fe187387c9 (diff)
Adding a stop button
Diffstat (limited to 'src/Update')
-rw-r--r--src/Update/UpdateTimer.elm6
1 files changed, 6 insertions, 0 deletions
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
+ }