From b3cc2f1421c4240b7c1d65abe625eed225753893 Mon Sep 17 00:00:00 2001 From: iliya Date: Sat, 21 Mar 2026 13:37:12 +0200 Subject: [PATCH] fix: update mainWindowRef on window close/recreate, remove dead code - Add teamProvisioningService.setMainWindow(null) in window close handler - Add teamProvisioningService.setMainWindow(mainWindow) in window recreate Without this, notification click focused destroyed window instead of new one - Remove unused dismissAllApprovalNotifications (cleanupRun uses per-requestId dismiss) --- src/main/index.ts | 6 ++++++ src/main/services/team/TeamProvisioningService.ts | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index f944a845..2ee7c6c1 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1263,6 +1263,9 @@ function createWindow(): void { if (ptyTerminalService) { ptyTerminalService.setMainWindow(null); } + if (teamProvisioningService) { + teamProvisioningService.setMainWindow(null); + } setEditorMainWindow(null); setReviewMainWindow(null); cleanupEditorState(); @@ -1287,6 +1290,9 @@ function createWindow(): void { if (ptyTerminalService) { ptyTerminalService.setMainWindow(mainWindow); } + if (teamProvisioningService) { + teamProvisioningService.setMainWindow(mainWindow); + } setEditorMainWindow(mainWindow); setReviewMainWindow(mainWindow); diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index e4d702ca..d7caa5bc 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -5449,14 +5449,6 @@ export class TeamProvisioningService { } } - /** Dismiss all OS notifications for a team's approvals (e.g. on team stop). */ - private dismissAllApprovalNotifications(): void { - for (const [, notification] of this.activeApprovalNotifications) { - notification.close(); - } - this.activeApprovalNotifications.clear(); - } - private formatToolApprovalBody(toolName: string, toolInput: Record): string { switch (toolName) { case 'Bash':