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)
This commit is contained in:
parent
0d74619241
commit
b3cc2f1421
2 changed files with 6 additions and 8 deletions
|
|
@ -1263,6 +1263,9 @@ function createWindow(): void {
|
||||||
if (ptyTerminalService) {
|
if (ptyTerminalService) {
|
||||||
ptyTerminalService.setMainWindow(null);
|
ptyTerminalService.setMainWindow(null);
|
||||||
}
|
}
|
||||||
|
if (teamProvisioningService) {
|
||||||
|
teamProvisioningService.setMainWindow(null);
|
||||||
|
}
|
||||||
setEditorMainWindow(null);
|
setEditorMainWindow(null);
|
||||||
setReviewMainWindow(null);
|
setReviewMainWindow(null);
|
||||||
cleanupEditorState();
|
cleanupEditorState();
|
||||||
|
|
@ -1287,6 +1290,9 @@ function createWindow(): void {
|
||||||
if (ptyTerminalService) {
|
if (ptyTerminalService) {
|
||||||
ptyTerminalService.setMainWindow(mainWindow);
|
ptyTerminalService.setMainWindow(mainWindow);
|
||||||
}
|
}
|
||||||
|
if (teamProvisioningService) {
|
||||||
|
teamProvisioningService.setMainWindow(mainWindow);
|
||||||
|
}
|
||||||
setEditorMainWindow(mainWindow);
|
setEditorMainWindow(mainWindow);
|
||||||
setReviewMainWindow(mainWindow);
|
setReviewMainWindow(mainWindow);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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, unknown>): string {
|
private formatToolApprovalBody(toolName: string, toolInput: Record<string, unknown>): string {
|
||||||
switch (toolName) {
|
switch (toolName) {
|
||||||
case 'Bash':
|
case 'Bash':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue