Electron update related: fix showSaveDialog elector api for deprecated callback (#21935)

* showSaveDialog

* fix lint
This commit is contained in:
Andrea Bogazzi 2021-02-08 19:06:04 +01:00 committed by GitHub
parent 394b468779
commit 8844d58595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -464,13 +464,13 @@ module.exports = class AtomWindow extends EventEmitter {
options options
); );
let promise = dialog.showSaveDialog(this.browserWindow, options);
if (typeof callback === 'function') { if (typeof callback === 'function') {
// Async promise = promise.then(({ filePath, bookmark }) => {
dialog.showSaveDialog(this.browserWindow, options, callback); callback(filePath, bookmark);
} else { });
// Sync
return dialog.showSaveDialog(this.browserWindow, options);
} }
return promise;
} }
toggleDevTools() { toggleDevTools() {