+
Skip to content

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Feb 19, 2019

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
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
Copy link
Contributor

zcbenz commented Feb 25, 2019

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
@codebytere codebytere force-pushed the promisify-showsavedialog branch from fa9b40b to fe0fa2d Compare March 5, 2019 00:03
@codebytere codebytere force-pushed the promisify-showsavedialog branch from 7960f88 to c2c9e68 Compare March 5, 2019 14:04
@codebytere codebytere merged commit 6cb7b8d into master Mar 5, 2019
@release-clerk
Copy link

release-clerk bot commented Mar 5, 2019

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

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
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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载