mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 23:05:49 +00:00
fix(startup): wait for app readiness before opening hud
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user