 }
 
 templateYakYak = (viewstate) ->
-    tmp = []
-    if os.platform() == 'darwin'
-        tmp = tmp.concat [
+    tmpl = []
+    if os.platform() == 'darwin'
+        tmpl.push [
             { label: 'About YakYak', selector: 'orderFrontStandardAboutPanel:' }
             #{ type: 'separator' }
             # { label: 'Preferences...', accelerator: 'Command+,',
             # click: => delegate.openConfig() }
             { type: 'separator' }
         ]
-    tmp = tmp.concat [
+    tmpl.push [
         {
             label: 'Hide YakYak'
             accelerator: acceleratorMap['hideyakyak'][os]

        }
    ]

templateOsx = (viewstate) -> [
    {
        label: 'YakYak'
        submenu: templateYakYak viewstate
    }, {
        label: 'Edit'
        submenu: templateEdit viewstate
    },{
        label: 'View'
        submenu: templateView viewstate
    }, {
        label: 'Window'
        submenu: templateWindow viewstate
    }
  ]

templateOthers = (viewstate) -> [
    {
        label: 'YakYak'
        submenu: templateYakYak viewstate
    }, {
        label: 'Edit'
        submenu: templateEdit viewstate
    },{
        label: 'View'
        submenu: templateView viewstate
    }
  ]

module.exports = (viewstate) ->
    if os.platform() == 'darwin'
        Menu.setApplicationMenu Menu.buildFromTemplate templateOsx(viewstate)
    else
        Menu.setApplicationMenu Menu.buildFromTemplate templateOthers(viewstate)

        }
    ]
    if os.platform() == 'darwin'
        tmpl.push {
            label: 'Hide Dock icon'
            type: 'checkbox'
            enabled: viewstate.showtray
            checked:  viewstate.hidedockicon
            click: -> action 'togglehidedockicon'
        }
    tmpl

templateWindow = (viewstate, os) ->
    tmpl = [
        {
            label: 'Minimize'
            accelerator: acceleratorMap['minimize'][os]
