ELECTRON-491 - Change method to use getFocusedWindow instead of fromWebContents (#368)

This commit is contained in:
Kiran Niranjan 2018-05-21 17:03:46 +05:30 committed by Vishwas Shashidhar
parent c36b639296
commit 2362febc58

View File

@ -515,7 +515,10 @@ function doCreateMainWindow(initialUrl, initialBounds) {
if (!userPermission) { if (!userPermission) {
let fullMessage = `Your administrator has disabled ${message}. Please contact your admin for help.`; let fullMessage = `Your administrator has disabled ${message}. Please contact your admin for help.`;
electron.dialog.showMessageBox(BrowserWindow.fromWebContents(webContents), {type: 'error', title: 'Permission Denied!', message: fullMessage}); const browserWindow = BrowserWindow.getFocusedWindow();
if (browserWindow && !browserWindow.isDestroyed()) {
electron.dialog.showMessageBox(browserWindow, {type: 'error', title: 'Permission Denied!', message: fullMessage});
}
} }
return cb(userPermission); return cb(userPermission);