Skip to content

Commit 8e820b2

Browse files
authored
🤖 fix: guard activate handler against services race condition (#1064)
On macOS, clicking the dock icon during startup (while splash is visible and services are loading) fires the activate event. The handler was calling `createWindow()` without checking if services were initialized, causing an assertion failure: ``` AssertionError: Services must be loaded before creating window at createWindow (src/desktop/main.ts:409:9) at App.<anonymous> (src/desktop/main.ts:611:7) ``` **Fix:** Added `services` check to the activate handler condition. If services aren't ready, the handler does nothing and normal startup flow creates the window. --- _Generated with `mux`_
1 parent a3edb20 commit 8e820b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/desktop/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,8 @@ if (gotTheLock) {
607607

608608
app.on("activate", () => {
609609
// Skip splash on reactivation - services already loaded, window creation is fast
610-
if (app.isReady() && mainWindow === null) {
610+
// Guard: services must be loaded (prevents race if activate fires during startup)
611+
if (app.isReady() && mainWindow === null && services) {
611612
createWindow();
612613
}
613614
});

0 commit comments

Comments
 (0)