 
   onDidBeginCheckingForUpdate: (callback) ->
     outerCallback = (event, message, detail) ->
-      if message is 'checking-for-update'
-        callback(detail)
+      callback(detail) if message is 'checking-for-update'
 
     ipcRenderer.on('message', outerCallback)
     new Disposable ->


  onDidCompleteDownloadingUpdate: (callback) ->
    outerCallback = (event, message, detail) ->
      if message is 'update-available'
        callback(detail)

    ipcRenderer.on('message', outerCallback)
    new Disposable ->


  onUpdateNotAvailable: (callback) ->
    outerCallback = (event, message, detail) ->
      callback(detail) if message is 'update-not-available'

    ipcRenderer.on('message', outerCallback)
    new Disposable ->
      ipcRenderer.removeListener('message', outerCallback)

  onApplicationMenuCommand: (callback) ->
    outerCallback = (event, args...) ->
