mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Pass current version to AutoUpdateManager
This commit is contained in:
@@ -65,7 +65,7 @@ class AtomApplication
|
||||
@pathsToOpen ?= []
|
||||
@windows = []
|
||||
|
||||
@autoUpdateManager = new AutoUpdateManager()
|
||||
@autoUpdateManager = new AutoUpdateManager(@version)
|
||||
@applicationMenu = new ApplicationMenu(@version)
|
||||
@atomProtocolHandler = new AtomProtocolHandler(@resourcePath)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user