avoid overriding type value of showMessageBox
This commit is contained in:
parent
5a50ce4157
commit
0b780def24
2 changed files with 4 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ node_modules/
|
||||||
*.xcodeproj
|
*.xcodeproj
|
||||||
*.swp
|
*.swp
|
||||||
*.pyc
|
*.pyc
|
||||||
|
npm-debug.log
|
||||||
|
|
|
@ -83,8 +83,8 @@ module.exports =
|
||||||
|
|
||||||
options ?= type: 'none'
|
options ?= type: 'none'
|
||||||
options.type ?= 'none'
|
options.type ?= 'none'
|
||||||
options.type = messageBoxTypes.indexOf options.type
|
messageBoxType = messageBoxTypes.indexOf options.type
|
||||||
throw new TypeError('Invalid message box type') unless options.type > -1
|
throw new TypeError('Invalid message box type') unless messageBoxType > -1
|
||||||
|
|
||||||
throw new TypeError('Buttons need to be array') unless Array.isArray options.buttons
|
throw new TypeError('Buttons need to be array') unless Array.isArray options.buttons
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ module.exports =
|
||||||
options.detail ?= ''
|
options.detail ?= ''
|
||||||
options.icon ?= null
|
options.icon ?= null
|
||||||
|
|
||||||
binding.showMessageBox options.type,
|
binding.showMessageBox messageBoxType,
|
||||||
options.buttons,
|
options.buttons,
|
||||||
[options.title, options.message, options.detail],
|
[options.title, options.message, options.detail],
|
||||||
options.icon,
|
options.icon,
|
||||||
|
|
Loading…
Reference in a new issue