New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: promisify dialog.showOpenDialog() #16973
Conversation
4bcec77
to
bb9cbc7
Compare
f0169e8
to
0cca779
Compare
4fd58e0
to
c056a03
Compare
c056a03
to
10cc766
Compare
Needs rebase on #17050 once it's merged. |
d3f91d1
to
2bca51f
Compare
f517b0e
to
271d772
Compare
ac6dc6e
to
6f4ba16
Compare
6f4ba16
to
9d9098a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please include this change as well a757e25?
it refactors the ELECTRON_INSPECTOR_SELECT_FILE
IPC handler to use the promisified version of dialog.showOpenDialog()
@miniak i'd rather that be a separate PR once this gets merged so they can be reviewed separately and not create scope creep |
0efad7d
to
674cb11
Compare
@codebytere ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fix needs to be included to avoid breaking devtools
diff --git a/lib/browser/chrome-devtools.js b/lib/browser/chrome-devtools.js
index f2db33344..b3aa84f0f 100644
--- a/lib/browser/chrome-devtools.js
+++ b/lib/browser/chrome-devtools.js
@@ -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)
Release Notes Persisted
|
* feat: promisify dialog.showOpenDialog() * address feedback from review * address feedback from review
Electron 6 used by Atom 1.54 splits the methods: - electron/electron#17298 - electron/electron#16973 Fixes: #5
Description of Change
Promisifies
dialog.showOpenDialog()
.cc @ckerr @MarshallOfSound @deepak1556
Checklist
npm test
passesRelease Notes
Notes: Split
dialog.showOpenDialog()
into a synchronous version and a version that returns a Promise