mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix: call initializeShellEnv directly in app ready handler (#7228)
Move the shell environment initialization from module-level into the app ready callback, avoiding a dangling promise at import time.
This commit is contained in:
@@ -5,9 +5,6 @@ const isDev = require('electron-is-dev');
|
||||
const os = require('os');
|
||||
const { initializeShellEnv } = require('@usebruno/requests');
|
||||
|
||||
// Fetch shell environment early (before app ready)
|
||||
const shellEnvPromise = initializeShellEnv();
|
||||
|
||||
if (isDev) {
|
||||
if (!fs.existsSync(path.join(__dirname, '../../bruno-js/src/sandbox/bundle-browser-rollup.js'))) {
|
||||
console.log('JS Sandbox libraries have not been bundled yet');
|
||||
@@ -160,7 +157,7 @@ if (useSingleInstance && !gotTheLock) {
|
||||
// Prepare the renderer once the app is ready
|
||||
app.on('ready', async () => {
|
||||
// Ensure shell environment is loaded before any operations that need it
|
||||
await shellEnvPromise;
|
||||
await initializeShellEnv();
|
||||
|
||||
if (isDev) {
|
||||
const { installExtension, REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');
|
||||
|
||||
Reference in New Issue
Block a user