bug fixed
This commit is contained in:
parent
205f71dfea
commit
be284a3240
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user