Skip to content

Commit

Permalink
💄 bootstrap-window
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Nov 20, 2020
1 parent 6f3fcd2 commit 1273299
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/bootstrap-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
const preloadGlobals = globals();
const sandbox = preloadGlobals.context.sandbox;
const webFrame = preloadGlobals.webFrame;
const safeProcess = sandbox ? preloadGlobals.process : process;
const safeProcess = preloadGlobals.process;
const configuration = parseWindowConfiguration();

// Start to resolve process.env before anything gets load
// so that we can run loading and resolving in parallel
const whenEnvResolved = preloadGlobals.process.resolveEnv(configuration.userEnv);
const whenEnvResolved = safeProcess.resolveEnv(configuration.userEnv);

/**
* @param {string[]} modulePaths
Expand Down Expand Up @@ -149,14 +149,12 @@

// Callback only after process environment is resolved
const callbackResult = resultCallback(result, configuration);
if (callbackResult && typeof callbackResult.then === 'function') {
callbackResult.then(() => {
if (developerToolsUnbind && options && options.removeDeveloperKeybindingsAfterLoad) {
developerToolsUnbind();
}
}, error => {
onUnexpectedError(error, enableDeveloperTools);
});
if (callbackResult instanceof Promise) {
await callbackResult;

if (developerToolsUnbind && options && options.removeDeveloperKeybindingsAfterLoad) {
developerToolsUnbind();
}
}
} catch (error) {
onUnexpectedError(error, enableDeveloperTools);
Expand Down

0 comments on commit 1273299

Please sign in to comment.