feat: promisify dialog.showMessageBox() #17298
Conversation
fbbd012 to
14b4f1c
Compare
8784230 to
72eaf8b
Compare
a1c60a1 to
125bf27
Compare
125bf27 to
fe834ac
Compare
atom/browser/api/atom_api_dialog.cc
Outdated
| cancel_id, options, title, message, detail, icon); | ||
| } | ||
|
|
||
| void ResolvePromiseObject(const atom::util::CopyablePromise& promise, |
There was a problem hiding this comment.
CopyablePromise should only be used when there is no other choice, such as passing it to some Chromium APIs.
For ShowMessageBox, we should change its callback type to base::OnceCallback, and then use base::BindOnce and move-only Promise for callbacks.
94dac9d to
ec9a591
Compare
ec9a591 to
44e7fa9
Compare
|
Release Notes Persisted
|
|
This should probably be listed as a "breaking change" in the release notes. Or maybe described with more context, e.g.:
Any existing call to |
|
I fully support @audionerd 's comment about updating the docs - I only caught this because the typings for electron updated to reflect the breaking API change and our typescript codebase failed to compile. |
Electron 6 used by Atom 1.54 splits the methods: - electron/electron#17298 - electron/electron#16973 Fixes: #5
Description of Change
Promisify
dialog.showMessageBox()by splitting it into a sync and async method.Checklist
npm testpassesRelease Notes
Notes: Split
dialog.showMessageBox()into a synchronous version and a version that returns a Promise.