chore: remove unused arg parsing code in dialog (#17420)
This commit is contained in:
parent
108545e416
commit
f09f43a4a9
1 changed files with 3 additions and 26 deletions
|
@ -15,32 +15,6 @@ const fileDialogProperties = {
|
|||
treatPackageAsDirectory: 1 << 7
|
||||
}
|
||||
|
||||
const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']
|
||||
|
||||
const messageBoxOptions = {
|
||||
noLink: 1 << 0
|
||||
}
|
||||
|
||||
const parseArgs = function (window, options, callback, ...args) {
|
||||
if (window != null && window.constructor !== BrowserWindow) {
|
||||
// Shift.
|
||||
[callback, options, window] = [options, window, null]
|
||||
}
|
||||
|
||||
if ((callback == null) && typeof options === 'function') {
|
||||
// Shift.
|
||||
[callback, options] = [options, null]
|
||||
}
|
||||
|
||||
// Fallback to using very last argument as the callback function
|
||||
const lastArgument = args[args.length - 1]
|
||||
if ((callback == null) && typeof lastArgument === 'function') {
|
||||
callback = lastArgument
|
||||
}
|
||||
|
||||
return [window, options, callback]
|
||||
}
|
||||
|
||||
const normalizeAccessKey = (text) => {
|
||||
if (typeof text !== 'string') return text
|
||||
|
||||
|
@ -144,6 +118,9 @@ const messageBox = (sync, window, options) => {
|
|||
if (window && window.constructor !== BrowserWindow) options = window
|
||||
if (options == null) options = { type: 'none' }
|
||||
|
||||
const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']
|
||||
const messageBoxOptions = { noLink: 1 << 0 }
|
||||
|
||||
let {
|
||||
buttons = [],
|
||||
cancelId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue