mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-20 11:48:30 -06:00
Merge pull request #221 from KiranNiranjan/ELECTRON-181
Electron-181 (Error: Object has been destroyed)
This commit is contained in:
commit
eee6fe8bc9
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user