Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Electron file dialog calling convention changed? #149
Electron problem. It appears they changed how a core routine works, the one that opens a file dialog. I'm trying to figure out how the changed version works.
The routine is: electron.remote.dialog.showSaveDialog.
Here's how I currently call it in all my apps.
What I expect to happen: The dialog opens, I navigate to or create a folder, enter a filename, click OK and the callback is called with the path to the file I chose.,
What happens: The callback is not called.
The theory -- they appear to have changed this to be a synchronous routine? Half the howtos on the web say do it this way, the other half say that dialog.showSaveDialog just returns the file path.
I recently upgraded the version of Electron I'm using, so am finding breakage scattered all over the place.
It looks like they changed the API in version 6: https://www.electronjs.org/releases/stable?version=6&page=5#release-notes-for-600
It no longer takes a callback, instead it returns a promise.
I made the changes, and they work.
This is what the routine above became.