From 30fc88f578b869a29a1ed143c2fc46436e4535af Mon Sep 17 00:00:00 2001 From: Optic00 Date: Mon, 6 Jul 2026 19:05:56 +0200 Subject: [PATCH] fix(main): guard app.on('activate') against firing before app.isReady() macOS can deliver 'activate' before Electron's own 'ready' event resolves (e.g. cold launch via Dock click), which crashed with 'Cannot create BrowserWindow before app is ready'. Mirrors the isReady() guard already used in the second-instance/open-url handlers; app.whenReady().then() still creates the initial window once ready. --- app/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/main.js b/app/main.js index c0665799..bb426b03 100644 --- a/app/main.js +++ b/app/main.js @@ -1493,6 +1493,12 @@ if (!gotSingleInstanceLock) { }); app.on('activate', () => { + // macOS can deliver 'activate' before Electron's own 'ready' event fires + // (e.g. cold launch via Dock). The whenReady().then() path below already + // creates the initial window once ready, so just no-op here until then - + // mirrors the same guard already used in the second-instance/open-url + // handlers above. + if (!app.isReady()) return; rewarmParakeet('activate'); if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore();