fix: sample collection creation race condition (#7665)

This commit is contained in:
Bijin A B
2026-04-03 13:55:12 +05:30
committed by GitHub
parent 5e1a36f8c8
commit f112c4fdd8
2 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -702,6 +702,8 @@ const registerWorkspaceIpc = (mainWindow, workspaceWatcher) => {
} catch (error) {
console.error('Error initializing workspaces:', error);
}
ipcMain.emit('main:workspaces-ready', win);
});
};