fix: notification click uses current window ref, dismiss on settings auto-allow

- Click handler reads this.mainWindowRef instead of captured closure ref,
  so window recreation is handled correctly
- reEvaluatePendingApprovals now calls dismissApprovalNotification when
  auto-allowing via settings change (was missing — stale notification stayed)
This commit is contained in:
iliya 2026-03-21 13:40:02 +02:00
parent b3cc2f1421
commit 95b282577f

View file

@ -5407,9 +5407,11 @@ export class TeamProvisioningService {
notification.on('click', () => {
cleanup();
if (win && !win.isDestroyed()) {
win.show();
win.focus();
// Use current mainWindowRef (not captured `win`) in case window was recreated
const currentWin = this.mainWindowRef;
if (currentWin && !currentWin.isDestroyed()) {
currentWin.show();
currentWin.focus();
}
});
@ -5582,6 +5584,7 @@ export class TeamProvisioningService {
if (result.autoAllow) {
this.clearApprovalTimeout(requestId);
this.autoAllowControlRequest(run, requestId);
this.dismissApprovalNotification(requestId);
toRemove.push(requestId);
this.emitToolApprovalEvent({
autoResolved: true,