diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index 8a7be9c8416..e74a3d463a5 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -271,17 +271,17 @@ class AtomApplication extends EventEmitter { async launch (options) { if (!this.configFilePromise) { - this.configFilePromise = this.configFile.watch() + this.configFilePromise = this.configFile.watch().then(disposable => { + this.disposable.add(disposable) + this.config.onDidChange('core.titleBar', () => this.promptForRestart()) + this.config.onDidChange('core.colorProfile', () => this.promptForRestart()) + }) // TodoElectronIssue: In electron v2 awaiting the watcher causes some delay // in Windows machines, which affects directly the startup time. - if (process.platform === 'win32') { - this.configFilePromise.then(disposable => this.disposable.add(disposable)) - } else { - this.disposable.add(await this.configFilePromise) + if (process.platform !== 'win32') { + await this.configFilePromise } - this.config.onDidChange('core.titleBar', () => this.promptForRestart()) - this.config.onDidChange('core.colorProfile', () => this.promptForRestart()) } let optionsForWindowsToOpen = []