Skip to content
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.showMessageBox() #17298

Merged
merged 2 commits into from Mar 12, 2019

Conversation

@codebytere
Copy link
Member

commented Mar 8, 2019

Description of Change

Promisify dialog.showMessageBox() by splitting it into a sync and async method.

Checklist

Release Notes

Notes: Split dialog.showMessageBox() into a synchronous version and a version that returns a Promise.

@codebytere codebytere force-pushed the promisify-showmessagebox branch from fbbd012 to 14b4f1c Mar 8, 2019

@codebytere codebytere referenced this pull request Mar 8, 2019

Closed

chore: add mate converter for long #17302

4 of 4 tasks complete

@codebytere codebytere force-pushed the promisify-showmessagebox branch 2 times, most recently from 8784230 to 72eaf8b Mar 8, 2019

@codebytere codebytere marked this pull request as ready for review Mar 8, 2019

@electron-cation electron-cation bot removed the new-pr 🌱 label Mar 9, 2019

@codebytere codebytere force-pushed the promisify-showmessagebox branch 2 times, most recently from a1c60a1 to 125bf27 Mar 11, 2019

@codebytere codebytere force-pushed the promisify-showmessagebox branch from 125bf27 to fe834ac Mar 11, 2019

cancel_id, options, title, message, detail, icon);
}

void ResolvePromiseObject(const atom::util::CopyablePromise& promise,

This comment has been minimized.

Copy link
@zcbenz

zcbenz Mar 11, 2019

Member

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.

@codebytere codebytere force-pushed the promisify-showmessagebox branch from 94dac9d to ec9a591 Mar 12, 2019

@codebytere codebytere requested a review from zcbenz Mar 12, 2019

@zcbenz

zcbenz approved these changes Mar 12, 2019

@codebytere codebytere force-pushed the promisify-showmessagebox branch from ec9a591 to 44e7fa9 Mar 12, 2019

@codebytere codebytere changed the title feat: promisify dialog.showMessageBox() feat: promisify dialog.showMessageBox() Mar 12, 2019

@codebytere codebytere merged commit 8991c00 into master Mar 12, 2019

12 of 13 checks passed

Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190312.21 succeeded
Details
electron-arm64-testing Build #20190312.21 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Mar 12, 2019

Release Notes Persisted

Split dialog.showMessageBox() into a synchronous version and a version that returns a Promise.

@codebytere codebytere deleted the promisify-showmessagebox branch Mar 12, 2019

@miniak miniak referenced this pull request Mar 13, 2019

Merged

refactor: make ELECTRON_INSPECTOR_CONFIRM handler async #17378

3 of 3 tasks complete

Kiku-Reise added a commit to Kiku-Reise/electron that referenced this pull request May 16, 2019

feat: promisify dialog.showMessageBox() (electron#17298)
* feat: promisify dialog.showMessageBox()

* address feedback from review
@audionerd

This comment has been minimized.

Copy link

commented Jul 30, 2019

This should probably be listed as a "breaking change" in the release notes. Or maybe described with more context, e.g.:

dialog.showMessageBox has been renamed to dialog.showMessageBoxSync. dialog.showMessageBox now returns a Promise.

Any existing call to dialog.showMessageBox will now return a Promise instead of a value. So users will need to change to dialog.showMessageBoxSync to return to the prior behavior, or modify their code to accept a Promise instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.