Fix restart behavior for "Restart and Install Update" on macOS

This commit is contained in:
David Wilson
2019-02-01 15:51:02 -08:00
parent 21d4e2794f
commit 2a97673781
2 changed files with 3 additions and 1 deletions

View File

@@ -91,6 +91,7 @@ class AtomApplication extends EventEmitter {
constructor (options) {
super()
this.quitting = false
this.quittingForUpdate = false
this.getAllWindows = this.getAllWindows.bind(this)
this.getLastFocusedWindow = this.getLastFocusedWindow.bind(this)
this.resourcePath = options.resourcePath
@@ -384,6 +385,7 @@ class AtomApplication extends EventEmitter {
this.on('application:install-update', () => {
this.quitting = true
this.quittingForUpdate = true
this.autoUpdateManager.install()
})

View File

@@ -148,7 +148,7 @@ class AtomWindow extends EventEmitter {
handleEvents () {
this.browserWindow.on('close', async event => {
if (!this.atomApplication.quitting && !this.unloading) {
if ((!this.atomApplication.quitting || this.atomApplication.quittingForUpdate) && !this.unloading) {
event.preventDefault()
this.unloading = true
this.atomApplication.saveCurrentWindowOptions(false)