Skip to content

feat: promisify dialog.showSaveDialog() - #17054

Merged
codebytere merged 4 commits into
masterfrom
promisify-showsavedialog
Mar 5, 2019
Merged

codebytere merged 4 commits into
masterfrom
promisify-showsavedialog

Conversation

@codebytere

@codebytere codebytere commented Feb 19, 2019 •

Copy link
Copy Markdown
Member

Description of Change

Promisifies dialog.showSaveDialog().

cc @ckerr @MarshallOfSound @deepak1556

Checklist

Release Notes

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

@codebytere
codebytere requested a review from a team February 19, 2019 14:41
@codebytere

Copy link
Copy Markdown
Member Author

Needs rebase on #17050 once it's merged.

@codebytere
codebytere force-pushed the promisify-showsavedialog branch 2 times, most recently from 3f7d228 to c9dba0b Compare February 20, 2019 08:39
@codebytere
codebytere requested a review from a team February 20, 2019 09:14
@codebytere codebytere changed the title [wip] feat: promisify dialog.showSaveDialog() feat: promisify dialog.showSaveDialog() Feb 20, 2019
@codebytere
codebytere force-pushed the promisify-showsavedialog branch from ef2d87c to 088fae3 Compare February 25, 2019 08:41
@zcbenz

zcbenz commented Feb 25, 2019

Copy link
Copy Markdown
Contributor

Review in #16973 (review) also applies here.

@codebytere codebytere added the semver/major incompatible API changes label Feb 26, 2019
@codebytere
codebytere force-pushed the promisify-showsavedialog branch 2 times, most recently from f4ac326 to 8c9d837 Compare February 27, 2019 09:08
@codebytere
codebytere force-pushed the promisify-showsavedialog branch 6 times, most recently from e2855cd to 063fd5e Compare March 4, 2019 17:14
Comment thread lib/browser/api/dialog.js Resolved
Comment thread docs/api/dialog.md Resolved
Comment thread docs/api/dialog.md Resolved
Comment thread atom/browser/ui/file_dialog_mac.mm Resolved
Comment thread docs/api/dialog.md Resolved
Comment thread lib/browser/api/dialog.js Resolved
@codebytere
codebytere force-pushed the promisify-showsavedialog branch from fa9b40b to fe0fa2d Compare March 5, 2019 00:03
Comment thread atom/browser/ui/file_dialog_win.cc Resolved
Comment thread atom/browser/ui/file_dialog_mac.mm Resolved
Comment thread atom/browser/ui/file_dialog_mac.mm Resolved
Comment thread atom/browser/ui/file_dialog_gtk.cc Resolved
Comment thread atom/browser/ui/file_dialog_gtk.cc Resolved
@codebytere
codebytere force-pushed the promisify-showsavedialog branch from 7960f88 to c2c9e68 Compare March 5, 2019 14:04
Comment thread atom/browser/ui/file_dialog_win.cc Resolved
@codebytere
codebytere merged commit 6cb7b8d into master Mar 5, 2019
@release-clerk

release-clerk Bot commented Mar 5, 2019

Copy link
Copy Markdown

Release Notes Persisted

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

@codebytere
codebytere deleted the promisify-showsavedialog branch March 5, 2019 21:48
@cristiammercado

Copy link
Copy Markdown

On Windows (I don't know in other platforms), the variable canceled is returning the inverted value: when the save window is canceled (click on cancel button), it sets to false, and when the save button is clicked (a filanme is setted), it returns true.

I'm not if report this issue in a new bug @miniak @codebytere , I don't have a repo to test the issue but I printed in my project in console:

When I select a filename and click Save:

Screenshot_1

When I click on Cancel and don't select any filename:

Screenshot_2

@codebytere

Copy link
Copy Markdown
Member Author

I'll handle that!

briandk added a commit to briandk/transcriptase that referenced this pull request Sep 23, 2019
Electron v. 6.0 introduced a sort-of breaking change: dialog functions now return promises by default. They used to take a callback function.

The breaking change means there are now explicitly synchronous versions of dialog methods—in this case: showMessageBoxSync.

Refs electron/electron#17054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/major incompatible API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants