Move window_udpate-evailable emitter to method

This commit is contained in:
probablycorey 2014-04-07 14:25:35 -07:00
parent bbc6433a75
commit 63e51af87d

View File

@ -34,13 +34,17 @@ class AutoUpdateManager
@setState(ERROR_STATE)
console.error "Error Downloading Update: #{message}"
autoUpdater.on 'update-downloaded', (event, releaseNotes, releaseVersion, releaseDate, releaseURL) =>
autoUpdater.on 'update-downloaded', (event, @releaseNotes, @releaseVersion) =>
@setState(UPDATE_AVAILABLE_STATE)
for atomWindow in @getWindows()
atomWindow.sendCommand('window:update-available', [releaseVersion, releaseNotes])
@emitUpdateAvailableEvent(@getWindows()...)
@check(hidePopups: true)
emitUpdateAvailableEvent: (windows...) ->
return unless @releaseVersion? and @releaseNotes
for atomWindow in windows
atomWindow.sendCommand('window:update-available', [@releaseVersion, @releaseNotes])
setState: (state) ->
return unless @state != state
@state = state