mirror of
https://github.com/electron/electron.git
synced 2026-01-26 15:58:07 -05:00
fix: set window to null when no window is passed (#18240)
* fix: set window to null when no window is passed * add new specs for dialog * fix process blocking for showMessageBox
This commit is contained in:
committed by
Charles Kerr
parent
e73a0e6cc6
commit
1a2ab11c90
@@ -47,7 +47,11 @@ const checkAppInitialized = function () {
|
||||
const saveDialog = (sync, window, options) => {
|
||||
checkAppInitialized()
|
||||
|
||||
if (window && window.constructor !== BrowserWindow) options = window
|
||||
if (window && window.constructor !== BrowserWindow) {
|
||||
options = window
|
||||
window = null
|
||||
}
|
||||
|
||||
if (options == null) options = { title: 'Save' }
|
||||
|
||||
const {
|
||||
@@ -74,7 +78,11 @@ const saveDialog = (sync, window, options) => {
|
||||
const openDialog = (sync, window, options) => {
|
||||
checkAppInitialized()
|
||||
|
||||
if (window && window.constructor !== BrowserWindow) options = window
|
||||
if (window && window.constructor !== BrowserWindow) {
|
||||
options = window
|
||||
window = null
|
||||
}
|
||||
|
||||
if (options == null) {
|
||||
options = {
|
||||
title: 'Open',
|
||||
@@ -115,7 +123,11 @@ const openDialog = (sync, window, options) => {
|
||||
const messageBox = (sync, window, options) => {
|
||||
checkAppInitialized()
|
||||
|
||||
if (window && window.constructor !== BrowserWindow) options = window
|
||||
if (window && window.constructor !== BrowserWindow) {
|
||||
options = window
|
||||
window = null
|
||||
}
|
||||
|
||||
if (options == null) options = { type: 'none' }
|
||||
|
||||
const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']
|
||||
|
||||
Reference in New Issue
Block a user