     else @checkKdStatus yes
 
 
-  setMenu: (menu, show = no) ->
+  setMenu: (menu = [], show = no) ->
 
     if typeof menu is 'string'
       menu = [ label: menu, enabled: no ]
 
-    @_contextMenu = Menu.buildFromTemplate menu.concat [
+    win = @_mainWindow
+    teams = @_previousTeams
+
+    menuItems = [
       type    : 'separator'
       visible : @_isKdRunning
     ,


Tray           = electron.Tray
Menu           = electron.Menu
{ app, shell } = electron

TRAY_ICON      = path.resolve path.join __dirname, '../assets/icons/kdTemplate.png'
TRAY_ICON_REV  = path.resolve path.join __dirname, '../assets/icons/kdRev.png'


module.exports = class KodingTray

  constructor: (mainWindow) ->

    # Globals
    @_mainWindow = mainWindow
    @_inProgress  = no
    @_isKdRunning = no
    @_contextMenu = []
    @_previousTeams = {}

    @tray = new Tray TRAY_ICON
    # @tray.setPressedImage TRAY_ICON_REV

    @tray.on 'click', => @handleClick()

    kallback = =>
      @checkKdStatus no
      @loadPreviousTeams()

    @_mainWindow.webContents.on 'did-navigate', kallback
    @_mainWindow.webContents.on 'did-navigate-in-page', kallback

    setTimeout kallback, 2000
    setInterval kallback, 1000 * CHECK_TIMER



  handleClick: ->
