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:
parent
e73a0e6cc6
commit
1a2ab11c90
2 changed files with 73 additions and 4 deletions
|
@ -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']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue