Merge pull request #221 from KiranNiranjan/ELECTRON-181

Electron-181 (Error: Object has been destroyed)
This commit is contained in:
Vikas Shashidhar 2017-10-25 18:41:27 +05:30 committed by GitHub
commit eee6fe8bc9

View File

@ -171,7 +171,7 @@ function setup() {
setupConfig();
// if display added/removed/changed then re-run setup and remove all existing
// notifications. ToDo: should reposition notifications rather than closing.
// notifications.
electron.screen.on('display-added', setupConfig);
electron.screen.on('display-removed', setupConfig);
electron.screen.on('display-metrics-changed', setupConfig);
@ -238,7 +238,6 @@ function calcDimensions() {
* Setup the notification config
*/
function setupConfig() {
closeAll();
// This feature only applies to windows
if (!isMac) {
@ -694,33 +693,6 @@ function getWindow() {
})
}
/**
* Closes all the notifications and windows
*/
function closeAll() {
// Clear out animation Queue and close windows
animationQueue.clear();
activeNotifications.forEach(function(window) {
if (window.displayTimer) {
clearTimeout(window.displayTimer);
}
if (window.electronNotifyOnCloseFunc) {
// ToDo: fix this: shouldn't delete method on arg
/* eslint-disable */
delete window.electronNotifyOnCloseFunc;
/* eslint-enable */
}
window.close();
});
cleanUpInactiveWindow();
// Reset certain vars
nextInsertPos = {};
activeNotifications = [];
}
/**
* Once a minute, remove inactive windows to free up memory used.
*/