mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Merge pull request #17166 from atom/mb-dont-save-config-while-quitting
Avoid writing to config file while quitting
This commit is contained in:
@@ -439,7 +439,11 @@ class AtomApplication extends EventEmitter {
|
||||
event.preventDefault()
|
||||
const windowUnloadPromises = this.getAllWindows().map(window => window.prepareToUnload())
|
||||
const windowUnloadedResults = await Promise.all(windowUnloadPromises)
|
||||
if (windowUnloadedResults.every(Boolean)) app.quit()
|
||||
if (windowUnloadedResults.every(Boolean)) {
|
||||
app.quit()
|
||||
} else {
|
||||
this.quitting = false
|
||||
}
|
||||
}
|
||||
|
||||
resolveBeforeQuitPromise()
|
||||
@@ -563,9 +567,11 @@ class AtomApplication extends EventEmitter {
|
||||
window.setPosition(x, y)
|
||||
}))
|
||||
|
||||
this.disposable.add(ipcHelpers.respondTo('set-user-settings', (window, settings, filePath) =>
|
||||
ConfigFile.at(filePath || this.configFilePath).update(JSON.parse(settings))
|
||||
))
|
||||
this.disposable.add(ipcHelpers.respondTo('set-user-settings', (window, settings, filePath) => {
|
||||
if (!this.quitting) {
|
||||
ConfigFile.at(filePath || this.configFilePath).update(JSON.parse(settings))
|
||||
}
|
||||
}))
|
||||
|
||||
this.disposable.add(ipcHelpers.respondTo('center-window', window => window.center()))
|
||||
this.disposable.add(ipcHelpers.respondTo('focus-window', window => window.focus()))
|
||||
|
||||
Reference in New Issue
Block a user