Add applicationDelegate.getAutoUpdateManagerErrorMessage()

Sometimes, the error event gets emitted before the renderer process has
the chance to subscribe. Therefore, we expose an
`autoUpdateManager.getErrorMessage()` in the browser process, so that we
don’t lose that information.
This commit is contained in:
Antonio Scandurra
2016-03-31 10:13:41 +02:00
parent e8e2370ed1
commit 4d4ee6bf3b
5 changed files with 19 additions and 7 deletions

View File

@@ -21,9 +21,8 @@ export default class AutoUpdateManager {
applicationDelegate.onUpdateNotAvailable(() => {
this.emitter.emit('update-not-available')
}),
applicationDelegate.onUpdateError((message) => {
console.error(message)
this.emitter.emit('update-error', message)
applicationDelegate.onUpdateError(() => {
this.emitter.emit('update-error')
})
)
}
@@ -45,6 +44,10 @@ export default class AutoUpdateManager {
return this.applicationDelegate.getAutoUpdateManagerState()
}
getErrorMessage () {
return this.applicationDelegate.getAutoUpdateManagerErrorMessage()
}
platformSupportsUpdates () {
return atom.getReleaseChannel() !== 'dev' && this.getState() !== 'unsupported'
}