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 = {} options.webPreferences = {}
} }
if (embedder.browserWindowOptions != null) { if (embedder.browserWindowOptions != null) {
let parentOptions = {...embedder.browserWindowOptions} let parentOptions = embedder.browserWindowOptions
// if parent's visibility is available, that overrides 'show' flag (#12125) // if parent's visibility is available, that overrides 'show' flag (#12125)
const win = BrowserWindow.fromWebContents(embedder.webContents) const win = BrowserWindow.fromWebContents(embedder.webContents)
if (win != null) { if (win != null) {
const show = win.isVisible() const show = win.isVisible()
if (typeof show === 'boolean') { if (typeof show === 'boolean') {
parentOptions.show = show parentOptions = {...embedder.browserWindowOptions, show: show}
} }
} }