From 9684c9457facec408a0279403b0ae5bfaa0d2484 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Wed, 18 Oct 2017 13:11:25 +0530 Subject: [PATCH] Electron-182 - Fixes an error that occurs when we add/remove displays --- .../settings/configure-notification-position.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/notify/settings/configure-notification-position.js b/js/notify/settings/configure-notification-position.js index e809210f..396abab6 100644 --- a/js/notify/settings/configure-notification-position.js +++ b/js/notify/settings/configure-notification-position.js @@ -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}); } /**