     currentDate = new Date
     events = []
 
+    wasWarning = @hasWarning
+    @hasWarning = false
     for title, times of @data
       # ignore missing titles and those starting with -
       if !title.length or title[0] == '-'

  attach: ->
    @statusBar?.addLeftTile(item: this, priority: 200) # far right side
    @setup()

  # Do all initial setup for view and configuration.
  setup: ->
    @setupView()

    @data = atom.config.get('event-watch.data')

    for event in events
      @view.appendChild(event)

    if !wasWarning && @hasWarning
      @setup(60000) # 1 minute refresh during warnings
    else if wasWarning && !@hasWarning
      @setup()

module.exports = document.registerElement('event-watch',
                                          prototype: EventWatchView.prototype,
                                          extends: 'div')
