feat: promisify dialog.showOpenDialog() (#16973)
* feat: promisify dialog.showOpenDialog() * address feedback from review * address feedback from review
This commit is contained in:
parent
7936237677
commit
e05985145b
12 changed files with 235 additions and 154 deletions
|
@ -86,9 +86,9 @@ ipcMainUtils.handle('ELECTRON_INSPECTOR_SELECT_FILE', function (event) {
|
|||
return new Promise((resolve, reject) => {
|
||||
assertChromeDevTools(event.sender, 'window.UI.createFileSelectorElement()')
|
||||
|
||||
dialog.showOpenDialog({}, function (files) {
|
||||
if (files) {
|
||||
const path = files[0]
|
||||
dialog.showOpenDialog({}, function (result) {
|
||||
if (!result.canceled) {
|
||||
const path = result.filePaths[0]
|
||||
fs.readFile(path, (error, data) => {
|
||||
if (error) {
|
||||
reject(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue