mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix: sample collection creation race condition (#7665)
This commit is contained in:
@@ -7,9 +7,9 @@ const { resolveDefaultLocation } = require('../utils/default-location');
|
||||
|
||||
let pendingSampleCollection = null;
|
||||
|
||||
// When renderer is ready, send any pending collection-opened event
|
||||
// This ensures the sample collection appears in the sidebar after onboarding
|
||||
ipcMain.on('main:renderer-ready', (mainWindow) => {
|
||||
// When workspaces are ready, send any pending collection-opened event
|
||||
// This ensures the sample collection appears in the sidebar after the workspace exists
|
||||
ipcMain.on('main:workspaces-ready', (mainWindow) => {
|
||||
if (pendingSampleCollection) {
|
||||
const { mainWindow: win, collectionPath, uid, brunoConfig } = pendingSampleCollection;
|
||||
win.webContents.send('main:collection-opened', collectionPath, uid, brunoConfig);
|
||||
|
||||
@@ -702,6 +702,8 @@ const registerWorkspaceIpc = (mainWindow, workspaceWatcher) => {
|
||||
} catch (error) {
|
||||
console.error('Error initializing workspaces:', error);
|
||||
}
|
||||
|
||||
ipcMain.emit('main:workspaces-ready', win);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user