       if not value?
         # Prepare the default value:
         value =
+          id: 'WORK'
           name: 'Work'
           estimated: 0
           elapsed: 0

              delta: 5
              start: Date.now()
              end: Date.now() + 5 * 60 * 1000
            save()
          else
            $scope.pomodoro.active = false

    save = () ->
      storage.store('tasks', $scope.rootTask)

  ]

      $scope.task = value
      $scope.hierarchy = [value]
      $scope.$apply()

      # Launch another fetch to get the live Pomodoro, if one exists.
      # This one must wait until all the tasks are retrieved.
      storage.fetch 'pomodoro', (value) ->
        if value?
          task = findTask(value.task)
          $scope.pomodoro =
            active: true
            type: 'task'
            task: task
            delta: value.delta
            start: Date.now()
            end: Date.now() + value.delta * 60 * 1000
          $scope.$apply()
          startTimer()

    timer = undefined

