|
@@ -10,7 +10,7 @@ class AutoUpdater extends EventEmitter {
|
|
|
return this.emitError('No update available, can\'t quit and install')
|
|
|
}
|
|
|
squirrelUpdate.processStart()
|
|
|
- return app.quit()
|
|
|
+ app.quit()
|
|
|
}
|
|
|
|
|
|
getFeedURL () {
|
|
@@ -34,21 +34,17 @@ class AutoUpdater extends EventEmitter {
|
|
|
return this.emitError(error)
|
|
|
}
|
|
|
if (update == null) {
|
|
|
- this.updateAvailable = false
|
|
|
return this.emit('update-not-available')
|
|
|
}
|
|
|
this.updateAvailable = true
|
|
|
this.emit('update-available')
|
|
|
squirrelUpdate.update(this.updateURL, (error) => {
|
|
|
- var date, releaseNotes, version
|
|
|
if (error != null) {
|
|
|
return this.emitError(error)
|
|
|
}
|
|
|
- releaseNotes = update.releaseNotes
|
|
|
- version = update.version
|
|
|
-
|
|
|
- // Following information is not available on Windows, so fake them.
|
|
|
- date = new Date()
|
|
|
+ const {releaseNotes, version} = update
|
|
|
+ // Date is not available on Windows, so fake it.
|
|
|
+ const date = new Date()
|
|
|
this.emit('update-downloaded', {}, releaseNotes, version, date, this.updateURL, () => {
|
|
|
this.quitAndInstall()
|
|
|
})
|
|
@@ -59,7 +55,7 @@ class AutoUpdater extends EventEmitter {
|
|
|
// Private: Emit both error object and message, this is to keep compatibility
|
|
|
// with Old APIs.
|
|
|
emitError (message) {
|
|
|
- return this.emit('error', new Error(message), message)
|
|
|
+ this.emit('error', new Error(message), message)
|
|
|
}
|
|
|
}
|
|
|
|