mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: remove unused arg parsing code in dialog (#17420)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user