Don't emit window:loaded event until async window initialization completes

Signed-off-by: Katrina Uychaco <kuychaco@github.com>
This commit is contained in:
Max Brunsfeld
2016-02-09 14:28:01 -08:00
committed by Katrina Uychaco
parent 656cac8814
commit 9b2c791c86
2 changed files with 6 additions and 3 deletions

View File

@@ -68,7 +68,9 @@ module.exports = ({blobStore}) ->
logFile, headless, testPaths, buildAtomEnvironment, buildDefaultApplicationDelegate, legacyTestRunner
})
promise.then(exitWithStatusCode) if getWindowLoadSettings().headless
promise.then (statusCode) ->
exitWithStatusCode(statusCode) if getWindowLoadSettings().headless
catch error
if getWindowLoadSettings().headless
console.error(error.stack ? error)

View File

@@ -83,8 +83,9 @@
setupCsonCache(CompileCache.getCacheDirectory())
var initialize = require(loadSettings.windowInitializationScript)
initialize({blobStore: blobStore})
require('ipc').sendChannel('window-command', 'window:loaded')
initialize({blobStore: blobStore}).then(function () {
require('ipc').sendChannel('window-command', 'window:loaded')
})
}
function setupCsonCache (cacheDir) {