fix(startup): wait for app readiness before opening hud

This commit is contained in:
webadderall
2026-03-28 22:02:16 +11:00
parent caf65cb59c
commit 7e3673bbd2
+16
View File
@@ -109,10 +109,26 @@ ipcMain.on("set-has-unsaved-changes", (_event, hasChanges: boolean) => {
});
function createWindow() {
if (!app.isReady()) {
void app.whenReady().then(() => {
if (!mainWindow || mainWindow.isDestroyed()) {
createWindow();
}
});
return;
}
mainWindow = createHudOverlayWindow();
}
function focusOrCreateMainWindow() {
if (!app.isReady()) {
void app.whenReady().then(() => {
focusOrCreateMainWindow();
});
return;
}
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
return;