From 9eb259ce2070f25906c8020d321a48503b3e9057 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Thu, 18 Apr 2019 17:03:43 -0400 Subject: [PATCH] Guarantee the window opening order --- src/main-process/atom-application.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index d0cd442a6..c31cd36da 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -266,9 +266,12 @@ class AtomApplication extends EventEmitter { optionsForWindowsToOpen.push(options) } - return Promise.all( - optionsForWindowsToOpen.map(options => this.openWithOptions(options)) - ) + // Preserve window opening order + const windows = [] + for (const options of optionsForWindowsToOpen) { + windows.push(await this.openWithOptions(options)) + } + return windows } openWithOptions (options) {