diff --git a/electron-projects/ucap-webmessenger-electron-notification/src/lib/services/electron-notification.service.ts b/electron-projects/ucap-webmessenger-electron-notification/src/lib/services/electron-notification.service.ts index fbfcceea..b6c11b7a 100644 --- a/electron-projects/ucap-webmessenger-electron-notification/src/lib/services/electron-notification.service.ts +++ b/electron-projects/ucap-webmessenger-electron-notification/src/lib/services/electron-notification.service.ts @@ -47,7 +47,6 @@ class BrowserWindowPooler { if (this.minSize < length) { this.start(); } - return length; } @@ -55,13 +54,7 @@ class BrowserWindowPooler { if (!this.inactiveWindows || 0 === this.inactiveWindows.length) { return undefined; } - - const w = this.inactiveWindows.pop(); - if (this.minSize >= this.inactiveWindows.length) { - this.stop(); - } - - return w; + return this.inactiveWindows.pop(); } closeAll() { @@ -72,23 +65,13 @@ class BrowserWindowPooler { } private start() { - if (!!this.handle) { - this.stop(); - } - this.handle = setTimeout(() => { + setTimeout(() => { while (this.minSize < this.inactiveWindows.length) { const w = this.inactiveWindows.pop(); w.close(); } }, 3000); } - - private stop() { - if (!!this.handle) { - clearTimeout(this.handle); - this.handle = undefined; - } - } } export class ElectronNotificationService { @@ -451,7 +434,10 @@ export class ElectronNotificationService { windowProperties.width = slef.customOptions.width; windowProperties.height = slef.customOptions.height; - const notificationWindow = new BrowserWindow(windowProperties); + const notificationWindow = new BrowserWindow({ + ...windowProperties, + title: 'Notification' + }); notificationWindow.setVisibleOnAllWorkspaces(true); notificationWindow.loadURL(slef.templatePath); notificationWindow.webContents.on(