aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-21 12:33:58 +0100
committerJoris Guyonvarch2015-03-21 12:33:58 +0100
commit9e6cf2f2f15b3fef1f99a2fcf980eb96945dc936 (patch)
tree3e460acb675bf1511baaaa603d1478f6464bba8a /src/Model
parent11403e9e7a07494d72df0b225216c15724386aa8 (diff)
Cannot delete a timer if it is the last one
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Model.elm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Model/Model.elm b/src/Model/Model.elm
index b7ac48a..ad1e9da 100644
--- a/src/Model/Model.elm
+++ b/src/Model/Model.elm
@@ -2,11 +2,13 @@ module Model.Model
( Model
, initialModel
, substractTimersTime
+ , numberOfTimers
) where
import Dict (Dict)
import Dict
import Time (Time)
+import List
import Model.Timer (..)
import Model.TimerEdition (..)
@@ -33,3 +35,6 @@ initialModel initialTime =
substractTimersTime : Time -> Dict Id Timer -> Dict Id Timer
substractTimersTime t timers =
Dict.map (\id timer -> substractTimerTime t timer) timers
+
+numberOfTimers : Model -> Int
+numberOfTimers = List.length << Dict.toList << .timers