Pass current version to AutoUpdateManager

This commit is contained in:
probablycorey
2014-04-07 15:28:42 -07:00
parent 6613b9fd4d
commit 980c17e50c
2 changed files with 4 additions and 7 deletions

View File

@@ -65,7 +65,7 @@ class AtomApplication
@pathsToOpen ?= []
@windows = []
@autoUpdateManager = new AutoUpdateManager()
@autoUpdateManager = new AutoUpdateManager(@version)
@applicationMenu = new ApplicationMenu(@version)
@atomProtocolHandler = new AtomProtocolHandler(@resourcePath)

View File

@@ -14,13 +14,13 @@ module.exports =
class AutoUpdateManager
_.extend @prototype, EventEmitter.prototype
constructor: ->
constructor: (@version) ->
@state = IDLE_STATE
# Only released versions should check for updates.
return if /\w{7}/.test(@getVersion())
return if /\w{7}/.test(@version())
autoUpdater.setFeedUrl "https://atom.io/api/updates?version=#{@getVersion()}"
autoUpdater.setFeedUrl "https://atom.io/api/updates?version=#{@version()}"
autoUpdater.on 'checking-for-update', =>
@setState(CHECKING_STATE)
@@ -72,8 +72,5 @@ class AutoUpdateManager
autoUpdater.removeListener 'update-not-available', @onUpdateNotAvailable
dialog.showMessageBox type: 'warning', buttons: ['OK'], message: 'There was an error checking for updates.', detail: message
getVersion: ->
global.atomApplication.version
getWindows: ->
global.atomApplication.windows