Electron-182 - Fixes an error that occurs when we add/remove displays

This commit is contained in:
Kiran Niranjan 2017-10-18 13:11:25 +05:30 committed by Kiran Niranjan
parent 0fd57a8dd0
commit 9684c9457f

View File

@ -48,12 +48,15 @@ function updateScreens() {
screens = electron.screen.getAllDisplays();
// Notifying renderer when a display is added/removed
if (configurationWindow && screens && screens.length >= 0) {
configurationWindow.webContents.send('screens', screens);
if (configurationWindow) {
// Event that updates the DOM elements
// notification position checkbox and monitor selection drop-down
configurationWindow.webContents.send('notificationSettings', {position: position, display: display});
if (screens && screens.length >= 0) {
configurationWindow.webContents.send('screens', screens);
}
}
// Event that updates the DOM elements
// notification position checkbox and monitor selection drop-down
configurationWindow.webContents.send('notificationSettings', {position: position, display: display});
}
/**