aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Model.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-16 20:37:44 +0100
committerJoris Guyonvarch2015-03-16 20:37:44 +0100
commit4e5f27a5b1428b9ad190a87a6bf0d4fe187387c9 (patch)
tree726182399610921064223cd0dd2b868a9ca710f8 /src/Model/Model.elm
parentcd3b37adebca99138fad1acca37908183036ace9 (diff)
Adding a remove button to delete a timer
Diffstat (limited to 'src/Model/Model.elm')
-rw-r--r--src/Model/Model.elm11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Model/Model.elm b/src/Model/Model.elm
index fa97d7b..a3b4780 100644
--- a/src/Model/Model.elm
+++ b/src/Model/Model.elm
@@ -21,11 +21,12 @@ type alias Model =
initialModel : Time -> Model
initialModel initialTime =
- { currentTime = initialTime
- , newTimerName = ""
- , timers = Dict.empty
- , timerIdGenerator = initialIdGenerator
- }
+ let (id, idGenerator) = getId initialIdGenerator
+ in { currentTime = initialTime
+ , newTimerName = ""
+ , timers = Dict.insert id (initialTimer initialTime "Timer") Dict.empty
+ , timerIdGenerator = idGenerator
+ }
substractTimersTime : Time -> Dict Id Timer -> Dict Id Timer
substractTimersTime t timers =