From 49e704291d2b299d1809e82c2a342f3237faf5ca Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 31 Jan 2018 09:24:15 -0700 Subject: [PATCH] Register for `core.titleBar` changes after the initial load of config This prevents the change handler for `core.titleBar` from being triggered every time a new instance of the main process is created. This fixes a regression that was causing users to be prompted for a restart every time they opened Atom. Co-authored-by: Max Brunsfeld Co-authored-by: Nathan Sobo --- src/main-process/atom-application.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index c57b43305..c2d40e92b 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -146,8 +146,6 @@ class AtomApplication extends EventEmitter { this.config.set('core.titleBar', 'custom') } - this.config.onDidChange('core.titleBar', this.promptForRestart.bind(this)) - process.nextTick(() => this.autoUpdateManager.initialize()) this.applicationMenu = new ApplicationMenu(this.version, this.autoUpdateManager) this.atomProtocolHandler = new AtomProtocolHandler(this.resourcePath, this.safeMode) @@ -171,6 +169,7 @@ class AtomApplication extends EventEmitter { if (!this.configFilePromise) { this.configFilePromise = this.configFile.watch() this.disposable.add(await this.configFilePromise) + this.config.onDidChange('core.titleBar', this.promptForRestart.bind(this)) } const optionsForWindowsToOpen = []