Remove unnecessary work when merging options

This commit is contained in:
Charles Kerr 2018-03-13 16:18:50 +09:00
parent e4d5ae53fc
commit 379bd79de4

View file

@ -47,14 +47,14 @@ const mergeBrowserWindowOptions = function (embedder, options) {
options.webPreferences = {}
}
if (embedder.browserWindowOptions != null) {
let parentOptions = {...embedder.browserWindowOptions}
let parentOptions = embedder.browserWindowOptions
// if parent's visibility is available, that overrides 'show' flag (#12125)
const win = BrowserWindow.fromWebContents(embedder.webContents)
if (win != null) {
const show = win.isVisible()
if (typeof show === 'boolean') {
parentOptions.show = show
parentOptions = {...embedder.browserWindowOptions, show: show}
}
}